feat(connection): add connection attempt cancellation

This commit is contained in:
Moe. authored and GitHub committed 2026-07-04 23:47:53 +08:00
1 parent 454457f191
commit 8a1a791927
16 files changed
+681 -51

No files matched your search

@@ -16,7 +16,7 @@ import { Switch } from "@/components/ui/switch";
import type { ConnectionConfig, DatabaseType, HttpTunnelConfig, JdbcDriverInfo, JdbcMavenBundleInfo, ProxyTunnelConfig, SshTunnelConfig, TransportLayerConfig } from "@/types/database";
import type { MqAdminConfig, MqAuth, MqSystemKind } from "@/types/mq";
import type { NacosAdminConfig, NacosAuthConfig } from "@/types/nacos";
import { useConnectionStore } from "@/stores/connectionStore";
import { CONNECTION_ATTEMPT_CANCELLED_MESSAGE, useConnectionStore } from "@/stores/connectionStore";
import { REDIS_SCAN_PAGE_SIZE_DEFAULT, REDIS_SCAN_PAGE_SIZE_MIN, REDIS_SCAN_PAGE_SIZE_MAX, REDIS_SCAN_PAGE_SIZE_OPTIONS } from "@/lib/redis/redisKeyPattern";
import { useSettingsStore } from "@/stores/settingsStore";
import { useToast } from "@/composables/useToast";
@@ -2991,8 +2991,10 @@ async function save() {
emit("connectSucceeded", config.name);
})
.catch((e: any) => {
const message = String(e?.message || e);
if (message.includes(CONNECTION_ATTEMPT_CANCELLED_MESSAGE)) return;
if (config.one_time) void store.removeConnection(config.id);
emit("connectFailed", mongodbAuthFailureHint(String(e?.message || e)));
emit("connectFailed", mongodbAuthFailureHint(message));
});
return;
}