feat(connections): import Navicat NCX files

This commit is contained in:
t8y2
2026-05-10 21:51:48 +08:00
parent 6d513afc16
commit 9661c60812
6 changed files with 263 additions and 35 deletions
+10 -3
View File
@@ -202,9 +202,9 @@ export function useDialogSources() {
}
}
async function onImportClick() {
async function onImportClick(source: "dbx" | "navicat" = "dbx") {
try {
const result = await connectionStore.readImportFile();
const result = await connectionStore.readImportFile(source);
if (!result) return;
pendingImportContent.value = result.content;
if (result.encrypted) {
@@ -213,7 +213,14 @@ export function useDialogSources() {
showConfigPassphraseDialog.value = true;
} else {
const { count, layout } = await connectionStore.importConnectionsFromFile(result.content, null);
toast(count > 0 ? t("configExport.importSuccess", { count }) : t("configExport.importNone"), 2000);
toast(
count > 0
? source === "navicat"
? t("configExport.importNavicatSuccess", { count })
: t("configExport.importSuccess", { count })
: t("configExport.importNone"),
4000,
);
if (layout && count > 0) {
pendingImportLayout.value = layout;
showImportLayoutConfirm.value = true;