From de3e934d8b22573061c9b0b942eab5618dd3e6a7 Mon Sep 17 00:00:00 2001 From: Sugar <93659702+wds824@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:21:30 +0800 Subject: [PATCH] fix(connection): improve save-and-connect flow and feedback (#23) * fix(connection): avoid duplicate saves on failed connect * fix(connection): show save-and-connect progress --- src/App.vue | 20 ++++- .../connection/ConnectionDialog.vue | 36 +++++++-- src/i18n/locales/en.ts | 3 + src/i18n/locales/zh-CN.ts | 3 + src/stores/connectionStore.ts | 75 ++++++++++++------- 5 files changed, 103 insertions(+), 34 deletions(-) diff --git a/src/App.vue b/src/App.vue index a638c288f5..882b427bbc 100644 --- a/src/App.vue +++ b/src/App.vue @@ -75,6 +75,18 @@ watch(showConnectionDialog, (v) => { if (!v) connectionStore.stopEditing(); }); +function onConnectionConnectStarted(name: string) { + toast(t("connection.connecting", { name }), 30000); +} + +function onConnectionConnectSucceeded(name: string) { + toast(t("connection.connectSuccess", { name }), 2000); +} + +function onConnectionConnectFailed(message: string) { + toast(t("connection.connectFailed", { message }), 5000); +} + const activeTab = computed(() => queryStore.tabs.find((t) => t.id === queryStore.activeTabId) ); @@ -953,7 +965,13 @@ async function setupFileDrop() { - + diff --git a/src/components/connection/ConnectionDialog.vue b/src/components/connection/ConnectionDialog.vue index 81310cfc3e..5d18903fd6 100644 --- a/src/components/connection/ConnectionDialog.vue +++ b/src/components/connection/ConnectionDialog.vue @@ -1,5 +1,5 @@