fix(export): show all dameng databases in export dropdown

This commit is contained in:
高桥凉介 authored and GitHub committed 2026-08-07 13:48:10 +08:00
1 parent 143fd96c3f
commit 9bb1b7aa91
10 files changed
+143 -33

No files matched your search

@@ -10,6 +10,7 @@ import PasswordInput from "@/components/ui/PasswordInput.vue";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { useConnectionStore } from "@/stores/connectionStore";
import { useToast } from "@/composables/useToast";
import { fetchNamespaceOptionsForConnection } from "@/composables/useDatabaseOptions";
import { useSqlHighlighter } from "@/composables/useSqlHighlighter";
import type { ConnectionConfig } from "@/types/database";
import * as api from "@/lib/backend/api";
@@ -223,7 +224,8 @@ async function openCreateUserDialog() {
createDatabasesLoading.value = true;
try {
await ensureConnection();
createDatabases.value = (await api.listDatabases(props.connection.id)).map((database) => database.name);
const config = props.connection;
createDatabases.value = config.db_type === "dameng" ? await fetchNamespaceOptionsForConnection(config.id, config) : (await api.listDatabases(config.id)).map((database) => database.name);
} catch (error: any) {
toast(t("userAdmin.loadDatabasesFailed", { message: error?.message || String(error) }), 5000);
} finally {