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(xugu): mark public synonym scope in sidebar
Elias0a239bddb292
diff --git a/apps/desktop/src/components/sidebar/TreeItem.vue b/apps/desktop/src/components/sidebar/TreeItem.vueindex 114609a7f9..8e84adfccf 100644--- a/apps/desktop/src/components/sidebar/TreeItem.vue+++ b/apps/desktop/src/components/sidebar/TreeItem.vue@@ -78,6 +78,7 @@ import { focusSidebarRenameInput } from "@/lib/sidebar/sidebarRenameFocus";import { ensureSqlExtension, stripSqlExtension } from "@/lib/savedSql/savedSqlFileName";import { savedSqlErrorMessage } from "@/lib/savedSql/savedSqlErrors";import { useSavedSqlStore } from "@/stores/savedSqlStore";+import { isXuguPublicSynonymTreeNode } from "@/lib/sidebar/xuguPublicSynonyms";// --- Drag and Drop ---import { useDragSort } from "@/composables/useDragSort";import { sidebarTreeRuntimeKey } from "@/lib/sidebar/sidebarTreeRuntime";@@ -235,8 +236,11 @@ function getIconInfo(node: TreeNode): { icon: any; colorClass: string } | null {return { icon: Database, colorClass: "text-yellow-500" };case "linked-server-schema":return { icon: FolderOpen, colorClass: "text-sky-400" };- case "schema":+ case "schema": {+ const databaseType = node.connectionId ? effectiveDatabaseTypeForConnection(connectionStore.getConfig(node.connectionId)) : undefined;+ if (isXuguPublicSynonymTreeNode(databaseType, node.type, node.schema)) return { icon: Link2, colorClass: "text-sky-500" };return { icon: FolderOpen, colorClass: "text-sky-400" };+ }case "table":return { icon: Table, colorClass: "text-green-500" };case "view":diff --git a/apps/desktop/src/components/sidebar/__tests__/xuguPublicSynonymActions.spec.ts b/apps/desktop/src/components/sidebar/__tests__/xuguPublicSynonymActions.spec.tsindex da44198d7f..624cd076af 100644--- a/apps/desktop/src/components/sidebar/__tests__/xuguPublicSynonymActions.spec.ts+++ b/apps/desktop/src/components/sidebar/__tests__/xuguPublicSynonymActions.spec.ts@@ -3,6 +3,7 @@ import { fileURLToPath } from "node:url";import { describe, expect, it } from "vitest";const runtimeSource = readFileSync(fileURLToPath(new URL("../SidebarTreeRuntimeHost.vue", import.meta.url)), "utf8");+const treeItemSource = readFileSync(fileURLToPath(new URL("../TreeItem.vue", import.meta.url)), "utf8");function functionSource(name: string): string {const start = runtimeSource.indexOf(`function ${name}(`);@@ -25,4 +26,9 @@ describe("Xugu public synonym actions", () => {expect(functionSource("dropSchema")).toContain("isXuguPublicSynonymTreeNode");expect(functionSource("confirmDropSchema")).toContain("isXuguPublicSynonymTreeNode");});++ it("uses a distinct link icon for the database-global synonym scope", () => {+ expect(treeItemSource).toContain("isXuguPublicSynonymTreeNode(databaseType, node.type, node.schema)");+ expect(treeItemSource).toContain('return { icon: Link2, colorClass: "text-sky-500" }');+ });});