mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-29 16:18:55 +00:00
fix(sidebar): 修复默认库过滤数据库树 (#175)
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import type { DatabaseInfo, TreeNode } from "@/types/database";
|
||||
|
||||
export function buildDatabaseTreeNodes(connectionId: string, databases: DatabaseInfo[]): TreeNode[] {
|
||||
return databases.map((db) => ({
|
||||
id: `${connectionId}:${db.name}`,
|
||||
label: db.name,
|
||||
type: "database" as const,
|
||||
connectionId,
|
||||
database: db.name,
|
||||
isExpanded: false,
|
||||
children: [],
|
||||
}));
|
||||
}
|
||||
Reference in New Issue
Block a user