From 251b80ebecc90478abedd4a727fd33ebc9470129 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 9 May 2026 15:14:32 +0900 Subject: [PATCH] refac --- .../Connections/OllamaConnection.svelte | 13 ++----------- .../Connections/OpenAIConnection.svelte | 12 ++---------- .../admin/Settings/Integrations.svelte | 18 +++--------------- .../Settings/Connections/Connection.svelte | 13 ++----------- .../Integrations/Terminals/Connection.svelte | 13 ++----------- .../chat/Settings/Tools/Connection.svelte | 13 ++----------- 6 files changed, 13 insertions(+), 69 deletions(-) diff --git a/src/lib/components/admin/Settings/Connections/OllamaConnection.svelte b/src/lib/components/admin/Settings/Connections/OllamaConnection.svelte index e4289dcf92..37048ceea6 100644 --- a/src/lib/components/admin/Settings/Connections/OllamaConnection.svelte +++ b/src/lib/components/admin/Settings/Connections/OllamaConnection.svelte @@ -6,7 +6,6 @@ import Switch from '$lib/components/common/Switch.svelte'; import SensitiveInput from '$lib/components/common/SensitiveInput.svelte'; import AddConnectionModal from '$lib/components/AddConnectionModal.svelte'; - import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; import Cog6 from '$lib/components/icons/Cog6.svelte'; import Wrench from '$lib/components/icons/Wrench.svelte'; @@ -22,7 +21,6 @@ let showManageModal = false; let showConfigModal = false; - let showDeleteConfirmDialog = false; { - showDeleteConfirmDialog = true; + onDelete(); + showConfigModal = false; }} onSubmit={(connection) => { url = connection.url; @@ -44,14 +43,6 @@ }} /> - { - onDelete(); - showConfigModal = false; - }} -/> -
diff --git a/src/lib/components/admin/Settings/Connections/OpenAIConnection.svelte b/src/lib/components/admin/Settings/Connections/OpenAIConnection.svelte index da9038457a..c543aa73e4 100644 --- a/src/lib/components/admin/Settings/Connections/OpenAIConnection.svelte +++ b/src/lib/components/admin/Settings/Connections/OpenAIConnection.svelte @@ -7,7 +7,6 @@ import SensitiveInput from '$lib/components/common/SensitiveInput.svelte'; import Cog6 from '$lib/components/icons/Cog6.svelte'; import AddConnectionModal from '$lib/components/AddConnectionModal.svelte'; - import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; import { connect } from 'socket.io-client'; @@ -21,16 +20,8 @@ export let config = {}; let showConfigModal = false; - let showDeleteConfirmDialog = false; - { - onDelete(); - }} -/> - { - showDeleteConfirmDialog = true; + onDelete(); + showConfigModal = false; }} onSubmit={(connection) => { url = connection.url; diff --git a/src/lib/components/admin/Settings/Integrations.svelte b/src/lib/components/admin/Settings/Integrations.svelte index a2a4075900..3f51aeebc4 100644 --- a/src/lib/components/admin/Settings/Integrations.svelte +++ b/src/lib/components/admin/Settings/Integrations.svelte @@ -22,7 +22,7 @@ import AddToolServerModal from '$lib/components/AddToolServerModal.svelte'; import AddTerminalServerModal from '$lib/components/AddTerminalServerModal.svelte'; - import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; + import { getToolServerConnections, @@ -40,8 +40,7 @@ let terminalConnections = []; let showAddTerminalModal = false; let editTerminalIdx: number | null = null; - let showDeleteTerminalConfirm = false; - let deleteTerminalIdx: number | null = null; + const addConnectionHandler = async (server) => { servers = [...servers, server]; @@ -135,23 +134,12 @@ }} onDelete={() => { if (editTerminalIdx !== null) { - deleteTerminalIdx = editTerminalIdx; - showDeleteTerminalConfirm = true; + removeTerminalConnection(editTerminalIdx); editTerminalIdx = null; } }} /> - { - if (deleteTerminalIdx !== null) { - removeTerminalConnection(deleteTerminalIdx); - deleteTerminalIdx = null; - } - }} -/> -
{ diff --git a/src/lib/components/chat/Settings/Connections/Connection.svelte b/src/lib/components/chat/Settings/Connections/Connection.svelte index 6779a396c9..6ce60ff6fe 100644 --- a/src/lib/components/chat/Settings/Connections/Connection.svelte +++ b/src/lib/components/chat/Settings/Connections/Connection.svelte @@ -8,7 +8,6 @@ import SensitiveInput from '$lib/components/common/SensitiveInput.svelte'; import Cog6 from '$lib/components/icons/Cog6.svelte'; import AddConnectionModal from '$lib/components/AddConnectionModal.svelte'; - import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; export let onDelete = () => {}; export let onSubmit = () => {}; @@ -20,7 +19,6 @@ export let config = {}; let showConfigModal = false; - let showDeleteConfirmDialog = false; { - showDeleteConfirmDialog = true; + onDelete(); + showConfigModal = false; }} onSubmit={(connection) => { url = connection.url; @@ -43,14 +42,6 @@ }} /> - { - onDelete(); - showConfigModal = false; - }} -/> -
void = () => {}; let showConfigModal = false; - let showDeleteConfirmDialog = false; { - showDeleteConfirmDialog = true; + onDelete(); + showConfigModal = false; }} onSubmit={(c) => { connection = c; @@ -33,14 +32,6 @@ }} /> - { - onDelete(); - showConfigModal = false; - }} -/> -
diff --git a/src/lib/components/chat/Settings/Tools/Connection.svelte b/src/lib/components/chat/Settings/Tools/Connection.svelte index fe79698cb4..0d50145243 100644 --- a/src/lib/components/chat/Settings/Tools/Connection.svelte +++ b/src/lib/components/chat/Settings/Tools/Connection.svelte @@ -6,7 +6,6 @@ import Switch from '$lib/components/common/Switch.svelte'; import SensitiveInput from '$lib/components/common/SensitiveInput.svelte'; import Cog6 from '$lib/components/icons/Cog6.svelte'; - import ConfirmDialog from '$lib/components/common/ConfirmDialog.svelte'; import AddToolServerModal from '$lib/components/AddToolServerModal.svelte'; import WrenchAlt from '$lib/components/icons/WrenchAlt.svelte'; @@ -17,7 +16,6 @@ export let direct = false; let showConfigModal = false; - let showDeleteConfirmDialog = false; { - showDeleteConfirmDialog = true; + onDelete(); + showConfigModal = false; }} onSubmit={(c) => { connection = c; @@ -34,14 +33,6 @@ }} /> - { - onDelete(); - showConfigModal = false; - }} -/> -