Skip to content

armgit / dbx

Public Imported from GitHub
0

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。

revert: restore single-click to open table data in sidebar

yavon007a3396f160122
diff --git a/src/components/sidebar/TreeItem.vue b/src/components/sidebar/TreeItem.vue
index e76744b17c..5e7a492540 100644
--- a/src/components/sidebar/TreeItem.vue
+++ b/src/components/sidebar/TreeItem.vue
@@ -199,15 +199,10 @@ async function toggle() {
function onClick() {
const node = props.node;
const action = treeNodeRowAction(node.type, canExpand);
- if (action === "toggle") {
- toggle();
- }
-}
-
-function onDblClick() {
- const node = props.node;
- if (node.type === "table" || node.type === "view") {
+ if (action === "open-data") {
openData();
+ } else if (action === "toggle") {
+ toggle();
}
}
@@ -772,7 +767,6 @@ const isDragging = computed(() =>
@mousedown="isDraggable ? startDrag($event, node.id, node.type) : undefined"
@mousemove="isDropTarget ? updateTarget($event, node.id, node.type) : undefined"
@mouseleave="clearTarget(node.id)"
- @dblclick="onDblClick"
>
<div v-if="showDropBefore" class="absolute right-2 top-0 h-0.5 bg-primary rounded-full pointer-events-none" :style="{ left: paddingLeft }" />
<div v-if="showDropAfter" class="absolute right-2 bottom-0 h-0.5 bg-primary rounded-full pointer-events-none" :style="{ left: paddingLeft }" />
diff --git a/src/lib/treeNodeClick.ts b/src/lib/treeNodeClick.ts
index 8dc5474804..55ca95c490 100644
--- a/src/lib/treeNodeClick.ts
+++ b/src/lib/treeNodeClick.ts
@@ -6,7 +6,7 @@ const dataNodeTypes = new Set<TreeNodeType>(["table", "view"]);
const toggleLeafNodeTypes = new Set<TreeNodeType>(["redis-db", "mongo-collection"]);
export function treeNodeRowAction(type: TreeNodeType, canExpand: boolean): TreeNodeRowAction {
- if (dataNodeTypes.has(type)) return "none";
+ if (dataNodeTypes.has(type)) return "open-data";
if (toggleLeafNodeTypes.has(type)) return "toggle";
if (canExpand) return "toggle";
return "none";