From 25d880bd62ed5dedd3516b23485730ea4e5d5f17 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Fri, 27 Nov 2026 02:42:47 +0400 Subject: [PATCH] refac --- src/lib/components/UserProfileModal.svelte | 2 +- .../Connections/ManageOllamaModal.svelte | 2 +- .../components/admin/Settings/Events.svelte | 2 +- .../admin/Settings/ExternalKnowledge.svelte | 2 +- .../Settings/Models/ManageModelsModal.svelte | 2 +- .../chat/MachineSessionsModal.svelte | 67 ++++++++++++------- .../ManageFloatingActionButtonsModal.svelte | 2 +- .../ManageImageCompressionModal.svelte | 2 +- .../chat/Settings/SyncStatsModal.svelte | 2 +- src/lib/components/chat/SettingsModal.svelte | 2 +- src/lib/components/comments/Comments.svelte | 2 +- src/lib/components/common/Modal.svelte | 2 +- src/lib/components/workspace/Prompts.svelte | 2 +- src/lib/i18n/locales/ar-BH/translation.json | 8 +++ src/lib/i18n/locales/ar/translation.json | 8 +++ src/lib/i18n/locales/az-AZ/translation.json | 4 ++ src/lib/i18n/locales/bg-BG/translation.json | 4 ++ src/lib/i18n/locales/bn-BD/translation.json | 4 ++ src/lib/i18n/locales/bo-TB/translation.json | 3 + src/lib/i18n/locales/bs-BA/translation.json | 5 ++ src/lib/i18n/locales/ca-ES/translation.json | 5 ++ src/lib/i18n/locales/ceb-PH/translation.json | 4 ++ src/lib/i18n/locales/cs-CZ/translation.json | 6 ++ src/lib/i18n/locales/da-DK/translation.json | 4 ++ src/lib/i18n/locales/de-DE/translation.json | 4 ++ src/lib/i18n/locales/dg-DG/translation.json | 4 ++ src/lib/i18n/locales/el-GR/translation.json | 4 ++ src/lib/i18n/locales/en-GB/translation.json | 4 ++ src/lib/i18n/locales/en-US/translation.json | 4 ++ src/lib/i18n/locales/es-ES/translation.json | 5 ++ src/lib/i18n/locales/et-EE/translation.json | 4 ++ src/lib/i18n/locales/eu-ES/translation.json | 4 ++ src/lib/i18n/locales/fa-IR/translation.json | 4 ++ src/lib/i18n/locales/fi-FI/translation.json | 4 ++ src/lib/i18n/locales/fil-PH/translation.json | 4 ++ src/lib/i18n/locales/fo-FO/translation.json | 4 ++ src/lib/i18n/locales/fr-CA/translation.json | 5 ++ src/lib/i18n/locales/fr-FR/translation.json | 5 ++ src/lib/i18n/locales/gl-ES/translation.json | 4 ++ src/lib/i18n/locales/he-IL/translation.json | 5 ++ src/lib/i18n/locales/hi-IN/translation.json | 4 ++ src/lib/i18n/locales/hr-HR/translation.json | 5 ++ src/lib/i18n/locales/hu-HU/translation.json | 4 ++ src/lib/i18n/locales/id-ID/translation.json | 3 + src/lib/i18n/locales/ie-GA/translation.json | 4 ++ src/lib/i18n/locales/it-IT/translation.json | 5 ++ src/lib/i18n/locales/ja-JP/translation.json | 3 + src/lib/i18n/locales/ka-GE/translation.json | 4 ++ src/lib/i18n/locales/kab-DZ/translation.json | 4 ++ src/lib/i18n/locales/ko-KR/translation.json | 3 + src/lib/i18n/locales/lt-LT/translation.json | 6 ++ src/lib/i18n/locales/lv-LV/translation.json | 5 ++ src/lib/i18n/locales/ms-MY/translation.json | 3 + src/lib/i18n/locales/nb-NO/translation.json | 4 ++ src/lib/i18n/locales/nl-NL/translation.json | 4 ++ src/lib/i18n/locales/pa-IN/translation.json | 4 ++ src/lib/i18n/locales/pl-PL/translation.json | 6 ++ src/lib/i18n/locales/pt-BR/translation.json | 5 ++ src/lib/i18n/locales/pt-PT/translation.json | 5 ++ src/lib/i18n/locales/ro-RO/translation.json | 5 ++ src/lib/i18n/locales/ru-RU/translation.json | 6 ++ src/lib/i18n/locales/sk-SK/translation.json | 6 ++ src/lib/i18n/locales/sl-SI/translation.json | 6 ++ src/lib/i18n/locales/sr-RS/translation.json | 5 ++ src/lib/i18n/locales/sv-SE/translation.json | 4 ++ src/lib/i18n/locales/ta-IN/translation.json | 4 ++ src/lib/i18n/locales/th-TH/translation.json | 3 + src/lib/i18n/locales/tk-TM/translation.json | 4 ++ src/lib/i18n/locales/tr-TR/translation.json | 4 ++ src/lib/i18n/locales/ug-CN/translation.json | 4 ++ src/lib/i18n/locales/uk-UA/translation.json | 6 ++ src/lib/i18n/locales/ur-PK/translation.json | 4 ++ .../i18n/locales/uz-Cyrl-UZ/translation.json | 4 ++ .../i18n/locales/uz-Latn-UZ/translation.json | 4 ++ src/lib/i18n/locales/vi-VN/translation.json | 3 + src/lib/i18n/locales/zh-CN/translation.json | 3 + src/lib/i18n/locales/zh-TW/translation.json | 3 + 77 files changed, 338 insertions(+), 35 deletions(-) diff --git a/src/lib/components/UserProfileModal.svelte b/src/lib/components/UserProfileModal.svelte index f8fb8059c6..eed842ec40 100644 --- a/src/lib/components/UserProfileModal.svelte +++ b/src/lib/components/UserProfileModal.svelte @@ -90,7 +90,7 @@
diff --git a/src/lib/components/admin/Settings/Events.svelte b/src/lib/components/admin/Settings/Events.svelte index 8a67800b41..776a2e553d 100644 --- a/src/lib/components/admin/Settings/Events.svelte +++ b/src/lib/components/admin/Settings/Events.svelte @@ -397,7 +397,7 @@ ariaLabel={editing ? $i18n.t('Edit webhook') : $i18n.t('Add webhook')} bind:show={showWebhookModal} size="sm" - className="bg-base-0 dark:bg-base-900 rounded-4xl" + className="bg-base-0 dark:bg-base-900 rounded-3xl" >
diff --git a/src/lib/components/admin/Settings/ExternalKnowledge.svelte b/src/lib/components/admin/Settings/ExternalKnowledge.svelte index 394b7ba955..0f3e5531bc 100644 --- a/src/lib/components/admin/Settings/ExternalKnowledge.svelte +++ b/src/lib/components/admin/Settings/ExternalKnowledge.svelte @@ -594,7 +594,7 @@ : $i18n.t('Add Knowledge Connection')} bind:show={showSourceModal} size="sm" - className="bg-base-0 dark:bg-base-900 rounded-4xl" + className="bg-base-0 dark:bg-base-900 rounded-3xl" >
diff --git a/src/lib/components/admin/Settings/Models/ManageModelsModal.svelte b/src/lib/components/admin/Settings/Models/ManageModelsModal.svelte index 60cda1b862..faa9a7cf2d 100644 --- a/src/lib/components/admin/Settings/Models/ManageModelsModal.svelte +++ b/src/lib/components/admin/Settings/Models/ManageModelsModal.svelte @@ -84,7 +84,7 @@ ariaLabel={$i18n.t('Manage Models')} size="sm" bind:show - className="bg-base-0 dark:bg-base-900 rounded-4xl" + className="bg-base-0 dark:bg-base-900 rounded-3xl" >
diff --git a/src/lib/components/chat/MachineSessionsModal.svelte b/src/lib/components/chat/MachineSessionsModal.svelte index e11b57b217..5dcfe753e6 100644 --- a/src/lib/components/chat/MachineSessionsModal.svelte +++ b/src/lib/components/chat/MachineSessionsModal.svelte @@ -37,7 +37,7 @@ let places: Record = {}; let error = ''; let loading = true; - let stopping: Session | null = null; + let stopping: Session | 'all' | null = null; let showConfirm = false; const folderIdOf = (id: string) => id.slice('folder:'.length, id.lastIndexOf(':')); @@ -74,14 +74,17 @@ } }; - const stop = async (session: Session) => { - try { - await machineRequest(target, `/sessions/${session.kind}/${encodeURIComponent(session.id)}`, { - method: 'DELETE' - }); - } catch (reason) { - error = reason instanceof Error ? reason.message : String(reason); - } + const stop = async (list: Session[]) => { + const results = await Promise.allSettled( + list.map((session) => + machineRequest(target, `/sessions/${session.kind}/${encodeURIComponent(session.id)}`, { + method: 'DELETE' + }) + ) + ); + const failed = results.find((result) => result.status === 'rejected'); + if (failed) + error = String(failed.reason instanceof Error ? failed.reason.message : failed.reason); await refresh(); }; @@ -112,14 +115,26 @@

{label}

- {[ - shells && $i18n.t('{{count}} shells', { count: shells }), - commands && $i18n.t('{{count}} commands', { count: commands }) - ] - .filter(Boolean) - .join(' · ')} +
+ {[ + shells && $i18n.t('{{count}} shells', { count: shells }), + commands && $i18n.t('{{count}} commands', { count: commands }) + ] + .filter(Boolean) + .join(' · ')} + {#if sessions.length} + + {/if} +