25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
feat(sidebar): 添加展开全部功能并支持多语言
二丫讲梵ad6e13dba8b8
diff --git a/apps/desktop/src/components/sidebar/TreeItem.vue b/apps/desktop/src/components/sidebar/TreeItem.vueindex a0e257894a..2b5a8aa049 100644--- a/apps/desktop/src/components/sidebar/TreeItem.vue+++ b/apps/desktop/src/components/sidebar/TreeItem.vue@@ -10,6 +10,7 @@ import {Eye,ChevronRight,ChevronDown,+ ChevronsDown,Loader2,FolderOpen,FolderClosed,@@ -599,6 +600,14 @@ async function loadMoreObjectGroupChildren() {}}+async function loadAllObjectGroupChildren() {+ try {+ await connectionStore.loadAllObjectGroupChildren(props.node);+ } catch (e: any) {+ toast(t("connection.connectFailed", { message: translateBackendError(t, e?.message || String(e)) }), 5000);+ }+}+function visibleTreeNodes(): TreeNode[] {if (sidebarTreeContext) return sidebarTreeContext.getVisibleNodes();return flattenTree(connectionStore.treeNodes).map((item) => item.node);@@ -3958,6 +3967,7 @@ function treeItemMenuItems(): ContextMenuItem[] {// 9. Group Labels (group-columns, group-tables, etc.)if (isGroupLabel(node)) {const hasGroupCreateAction = (node.type === "group-tables" && canCreateTable.value) || (node.type === "group-views" && !!node.connectionId && !!node.database);+ const canLoadAllObjectGroup = node.type === "group-tables" || node.type === "group-views" || node.type === "group-materialized-views";if (node.type === "group-tables" && canCreateTable.value) {items.push({ label: t("contextMenu.createTable"), action: createTable, icon: Plus });}@@ -3967,6 +3977,14 @@ function treeItemMenuItems(): ContextMenuItem[] {if (hasGroupCreateAction) {items.push({ label: "", separator: true });}+ if (canLoadAllObjectGroup) {+ items.push({+ label: t("contextMenu.expandAll"),+ action: loadAllObjectGroupChildren,+ icon: ChevronsDown,+ disabled: node.isLoading,+ });+ }if (node.type !== "group-partitions") {items.push({label: t("contextMenu.refreshChildren"),diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.tsindex 926c8fb5df..7a0f9f5f44 100644--- a/apps/desktop/src/i18n/locales/en.ts+++ b/apps/desktop/src/i18n/locales/en.ts@@ -1172,6 +1172,7 @@ export default {viewData: "View Data",editStructure: "Edit Structure",refreshChildren: "Refresh",+ expandAll: "Expand All",pin: "Pin",unpin: "Unpin",refreshTab: "Refresh Data",diff --git a/apps/desktop/src/i18n/locales/es.ts b/apps/desktop/src/i18n/locales/es.tsindex 3b03b43fd4..2185224dfc 100644--- a/apps/desktop/src/i18n/locales/es.ts+++ b/apps/desktop/src/i18n/locales/es.ts@@ -990,6 +990,7 @@ export default {viewData: "Ver datos",editStructure: "Editar estructura",refreshChildren: "Actualizar",+ expandAll: "Expandir todo",pin: "Fijar",unpin: "Desfijar",refreshTab: "Actualizar datos",diff --git a/apps/desktop/src/i18n/locales/it.ts b/apps/desktop/src/i18n/locales/it.tsindex 479a812cb4..787e34b66c 100644--- a/apps/desktop/src/i18n/locales/it.ts+++ b/apps/desktop/src/i18n/locales/it.ts@@ -1097,6 +1097,7 @@ export default {viewData: "Visualizza Dati",editStructure: "Modifica Struttura",refreshChildren: "Aggiorna",+ expandAll: "Espandi tutto",pin: "Fissa",unpin: "Sblocca",refreshTab: "Aggiorna Dati",diff --git a/apps/desktop/src/i18n/locales/ja.ts b/apps/desktop/src/i18n/locales/ja.tsindex 18e2d76aa2..e419172586 100644--- a/apps/desktop/src/i18n/locales/ja.ts+++ b/apps/desktop/src/i18n/locales/ja.ts@@ -1151,6 +1151,7 @@ export default {viewData: "データを表示",editStructure: "構造を編集",refreshChildren: "更新",+ expandAll: "すべて展開",pin: "ピン留め",unpin: "ピン留め解除",refreshTab: "データを更新",diff --git a/apps/desktop/src/i18n/locales/pt-BR.ts b/apps/desktop/src/i18n/locales/pt-BR.tsindex 46e9201627..0d1a6fbba6 100644--- a/apps/desktop/src/i18n/locales/pt-BR.ts+++ b/apps/desktop/src/i18n/locales/pt-BR.ts@@ -1097,6 +1097,7 @@ export default {viewData: "Ver Dados",editStructure: "Editar Estrutura",refreshChildren: "Atualizar",+ expandAll: "Expandir tudo",pin: "Fixar",unpin: "Desafixar",refreshTab: "Atualizar Dados",diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.tsindex 7b662cac26..fcde49ee0b 100644--- a/apps/desktop/src/i18n/locales/zh-CN.ts+++ b/apps/desktop/src/i18n/locales/zh-CN.ts@@ -1171,6 +1171,7 @@ export default {viewData: "查看数据",editStructure: "编辑表结构",refreshChildren: "刷新",+ expandAll: "展开全部",pin: "置顶",unpin: "取消置顶",refreshTab: "刷新数据",diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.tsindex cd83620852..5195985232 100644--- a/apps/desktop/src/i18n/locales/zh-TW.ts+++ b/apps/desktop/src/i18n/locales/zh-TW.ts@@ -1077,6 +1077,7 @@ export default {viewData: "檢視資料",editStructure: "編輯資料表結構",refreshChildren: "重新整理",+ expandAll: "展開全部",pin: "置頂",unpin: "取消置頂",refreshTab: "重新整理資料",diff --git a/apps/desktop/src/stores/connectionStore.ts b/apps/desktop/src/stores/connectionStore.tsindex 5054cdb1ec..814c75eece 100644--- a/apps/desktop/src/stores/connectionStore.ts+++ b/apps/desktop/src/stores/connectionStore.ts@@ -2028,6 +2028,31 @@ export const useConnectionStore = defineStore("connection", () => {}}+ async function loadAllObjectGroupChildren(parent: TreeNode) {+ if (!parent.connectionId || !hasTreeNodeDatabaseContext(parent)) return;+ if (!objectTypesForGroupNode(parent.type)) return;+ parent.isLoading = true;+ try {+ await ensureConnected(parent.connectionId);+ if (!isTreeNodeChildrenLoaded(parent.id)) {+ await loadObjectGroupChildren(parent);+ }++ let loadMoreNode = parent.children?.find((child) => child.type === "load-more");+ while (loadMoreNode?.loadMore) {+ loadMoreNode.isLoading = true;+ await loadMoreObjectGroupChildren(loadMoreNode);+ loadMoreNode = parent.children?.find((child) => child.type === "load-more");+ }+ parent.isExpanded = true;+ } catch (e) {+ recordMetadataLoadError(parent.connectionId, e);+ throw e;+ } finally {+ parent.isLoading = false;+ }+ }+function normalizedObjectTreeKind(type: string): DatabaseObjectTreeKind {return normalizeSidebarObjectKind(type);}@@ -3635,6 +3660,7 @@ export const useConnectionStore = defineStore("connection", () => {loadTables,loadObjectGroupChildren,loadMoreObjectGroupChildren,+ loadAllObjectGroupChildren,loadTableGroups,loadColumns,loadIndexes,