feat(zookeeper): add agent client browsing and node management

This commit is contained in:
miracle authored and GitHub committed 2026-06-25 00:40:48 +08:00
1 parent a0df43c391
commit 0effda91b3
65 files changed
+2037 -420

No files matched your search

+42 -1
View File
@@ -52,6 +52,7 @@ import { useSettingsStore } from "@/stores/settingsStore";
import { encodeSqlServerLinkedSchema, parseSqlServerLinkedSchema } from "@/lib/sqlServerLinkedServers";
import { inferMongoCompletionFields, type MongoCompletionField } from "@/lib/mongoCompletion";
import { completionSchemasFromTree, completionTablesFromTree } from "@/lib/completionTreeIndex";
import { kvRootNodeLabel } from "@/lib/kvRootPresentation";
const PINNED_TREE_NODES_STORAGE_KEY = "dbx-pinned-tree-nodes";
const ACTIVE_CONNECTION_STORAGE_KEY = "dbx-active-connection";
@@ -398,6 +399,7 @@ export const useConnectionStore = defineStore("connection", () => {
sqlite: "SQLite",
redis: "Redis",
etcd: "etcd",
zookeeper: "Apache ZooKeeper",
duckdb: "DuckDB",
clickhouse: "ClickHouse",
sqlserver: "SQL Server",
@@ -947,6 +949,8 @@ export const useConnectionStore = defineStore("connection", () => {
await loadRedisDatabases(connectionId);
} else if (config.db_type === "etcd") {
await loadEtcdRoot(connectionId);
} else if (config.db_type === "zookeeper") {
await loadZooKeeperRoot(connectionId);
} else if (config.db_type === "mongodb") {
await loadMongoDatabases(connectionId);
} else if (config.db_type === "elasticsearch") {
@@ -1257,7 +1261,7 @@ export const useConnectionStore = defineStore("connection", () => {
[
{
id: `${connectionId}:etcd`,
label: "Keys",
label: kvRootNodeLabel("etcd"),
type: "etcd-root" as const,
connectionId,
database: "",
@@ -1277,6 +1281,40 @@ export const useConnectionStore = defineStore("connection", () => {
}
}
async function loadZooKeeperRoot(connectionId: string) {
const node = findNode(treeNodes.value, connectionId);
if (!node) return;
node.isLoading = true;
try {
await ensureConnected(connectionId);
setChildren(
node,
withSavedSqlRoot(
connectionId,
[
{
id: `${connectionId}:zookeeper`,
label: kvRootNodeLabel("zookeeper"),
type: "zookeeper-root" as const,
connectionId,
database: "",
isExpanded: false,
children: [],
},
],
node,
),
);
node.isExpanded = true;
} catch (e) {
recordMetadataLoadError(connectionId, e);
throw e;
} finally {
node.isLoading = false;
}
}
async function loadMqTenants(connectionId: string, options?: LoadTreeOptions) {
const node = findNode(treeNodes.value, connectionId);
if (!node) return;
@@ -2112,6 +2150,8 @@ export const useConnectionStore = defineStore("connection", () => {
await loadRedisDatabases(node.connectionId);
} else if (config?.db_type === "etcd") {
await loadEtcdRoot(node.connectionId);
} else if (config?.db_type === "zookeeper") {
await loadZooKeeperRoot(node.connectionId);
} else if (config?.db_type === "mongodb") {
await loadMongoDatabases(node.connectionId);
} else if (config?.db_type === "elasticsearch") {
@@ -3391,6 +3431,7 @@ export const useConnectionStore = defineStore("connection", () => {
loadRedisDatabases,
refreshRedisDbKeyCounts,
loadEtcdRoot,
loadZooKeeperRoot,
loadMqTenants,
loadNacosNamespaces,
updateRedisDbKeyStats,