This commit is contained in:
Timothy Jaeryang Baek
2026-03-13 16:28:01 -05:00
parent d85b52bfc2
commit 157ff57c40
3 changed files with 81 additions and 48 deletions
+26 -13
View File
@@ -14,6 +14,7 @@
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
import Tooltip from '$lib/components/common/Tooltip.svelte';
import Switch from '$lib/components/common/Switch.svelte';
import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte';
import Tags from './common/Tags.svelte';
import Spinner from '$lib/components/common/Spinner.svelte';
import XMark from '$lib/components/icons/XMark.svelte';
@@ -52,6 +53,7 @@
let modelIds = [];
let loading = false;
let showDeleteConfirmDialog = false;
const verifyOllamaHandler = async () => {
// remove trailing slash from url
@@ -684,19 +686,20 @@
</div>
</div>
<div class="flex justify-end pt-3 text-sm font-medium gap-1.5">
{#if edit}
<button
class="px-3.5 py-1.5 text-sm font-medium dark:bg-black dark:hover:bg-gray-900 dark:text-white bg-white text-black hover:bg-gray-100 transition rounded-full flex flex-row space-x-1 items-center"
type="button"
on:click={() => {
onDelete();
show = false;
}}
>
{$i18n.t('Delete')}
</button>
{/if}
<div class="flex justify-between items-center pt-3 text-sm font-medium">
<div>
{#if edit}
<button
class="px-1 py-1.5 text-sm font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 hover:underline transition"
type="button"
on:click={() => {
showDeleteConfirmDialog = true;
}}
>
{$i18n.t('Delete')}
</button>
{/if}
</div>
<button
class="px-3.5 py-1.5 text-sm font-medium bg-black hover:bg-gray-900 text-white dark:bg-white dark:text-black dark:hover:bg-gray-100 transition rounded-full flex items-center gap-2 whitespace-nowrap {loading
@@ -719,3 +722,13 @@
</div>
</div>
</Modal>
<ConfirmDialog
bind:show={showDeleteConfirmDialog}
message={$i18n.t('Are you sure you want to delete this connection? This action cannot be undone.')}
confirmLabel={$i18n.t('Delete')}
on:confirm={() => {
onDelete();
show = false;
}}
/>