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。

3.4 KB
Raw Blame
<script setup lang="ts">
import { Activity, AlertTriangle, Braces, CalendarClock, Clock, Code2, Database, Eye, FileCode, Gauge, KeyRound, Link2, ListTree, Network, Package, PencilRuler, ScrollText, Search, ShieldCheck, Table, TableProperties, UsersRound, Zap } from "@lucide/vue";
import DatabaseIcon from "@/components/icons/DatabaseIcon.vue";
import PluginIcon from "@/components/plugins/PluginIcon.vue";
import { isEventObjectBrowserTab, tabDatabaseIconType } from "@/lib/tabs/tabPresentation";
import type { QueryTab } from "@/types/database";

// Mirrors EditorGroupTabBar's per-mode tab icon chain so surfaces outside the
// group bar (e.g. the special-page strip's return tabs) render identical icons.
defineProps<{ tab: QueryTab }>();
</script>

<template>
  <AlertTriangle v-if="tab.externalSqlFileMissing" />
  <Eye v-else-if="tab.objectSource?.objectType === 'VIEW' || tab.objectSource?.objectType === 'MATERIALIZED_VIEW' || tab.tableMeta?.tableType?.toUpperCase() === 'VIEW' || tab.tableMeta?.tableType?.toUpperCase() === 'MATERIALIZED_VIEW'" />
  <Database v-else-if="tab.mode === 'redis'" />
  <Table v-else-if="tab.mode === 'data' || tab.mode === 'mongo' || tab.mode === 'hbase'" />
  <DatabaseIcon v-else-if="tab.mode === 'mq'" :db-type="tabDatabaseIconType(tab)" />
  <TableProperties v-else-if="tab.mode === 'vector'" />
  <KeyRound v-else-if="tab.mode === 'etcd' || tab.mode === 'zookeeper' || tab.mode === 'consul'" />
  <Gauge v-else-if="tab.mode === 'consul-overview' || tab.mode === 'etcd-dashboard' || tab.mode === 'mysql-dashboard' || tab.mode === 'postgres-dashboard' || tab.mode === 'nacos-dashboard'" />
  <ShieldCheck v-else-if="tab.mode === 'etcd-access-control'" />
  <Network v-else-if="tab.mode === 'nacos'" />
  <Database v-else-if="tab.mode === 'databases'" />
  <Clock v-else-if="isEventObjectBrowserTab(tab)" />
  <TableProperties v-else-if="tab.mode === 'objects'" />
  <UsersRound v-else-if="tab.mode === 'users'" />
  <PencilRuler v-else-if="tab.mode === 'structure'" />
  <Search v-else-if="tab.mode === 'database-search'" />
  <ScrollText v-else-if="tab.objectSource?.objectType === 'PROCEDURE'" />
  <Braces v-else-if="tab.objectSource?.objectType === 'FUNCTION'" />
  <Zap v-else-if="tab.objectSource?.objectType === 'TRIGGER'" />
  <Clock v-else-if="tab.objectSource?.objectType === 'EVENT' || tab.objectSource?.objectType === 'JOB'" />
  <ListTree v-else-if="tab.objectSource?.objectType === 'SEQUENCE'" />
  <Link2 v-else-if="tab.objectSource?.objectType === 'SYNONYM'" />
  <Package v-else-if="tab.objectSource?.objectType === 'PACKAGE'" />
  <FileCode v-else-if="tab.objectSource?.objectType === 'PACKAGE_BODY'" />
  <Braces v-else-if="tab.objectSource?.objectType === 'TYPE'" />
  <FileCode v-else-if="tab.objectSource?.objectType === 'TYPE_BODY'" />
  <CalendarClock v-else-if="tab.mode === 'dameng-jobs' || tab.mode === 'database-jobs'" />
  <Activity v-else-if="tab.mode === 'processlist' || tab.mode === 'sqlserver-trace'" />
  <Gauge v-else-if="tab.mode === 'dolt-version-control'" />
  <PluginIcon v-else-if="tab.mode === 'plugin-workbench' && tab.pluginWorkbench" :plugin-id="tab.pluginWorkbench.pluginId" :contribution-id="tab.pluginWorkbench.contributionId" />
  <PluginIcon v-else-if="tab.mode === 'plugin-filesystem' && tab.pluginFilesystem" :plugin-id="tab.pluginFilesystem.pluginId" :contribution-id="tab.pluginFilesystem.providerId" />
  <FileCode v-else-if="tab.mode === 'query'" />
  <Code2 v-else />
</template>