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。

feat(updates): use compact one-line lists and underline tabs in update center

t8y20fbdd86ac371
diff --git a/apps/desktop/src/components/layout/UpdateDialog.spec.ts b/apps/desktop/src/components/layout/UpdateDialog.spec.ts
index 3c5bc1d886..e415756477 100644
--- a/apps/desktop/src/components/layout/UpdateDialog.spec.ts
+++ b/apps/desktop/src/components/layout/UpdateDialog.spec.ts
@@ -686,7 +686,7 @@ describe("UpdateDialog aggregate update center", () => {
// "Update all" skips the changed-source plugin, so the dialog has to explain why it stays.
const hint = "Confirm the change in the Plugin Center first";
- const rows = [...document.body.querySelectorAll<HTMLElement>(".rounded-md.border.p-3")];
+ const rows = [...document.body.querySelectorAll<HTMLElement>("[data-update-entry]")];
const rowFor = (name: string) => rows.find((row) => row.textContent?.includes(name));
expect(rowFor("moved plugin")?.textContent).toContain(hint);
expect(rowFor("same plugin")?.textContent).not.toContain(hint);
diff --git a/apps/desktop/src/components/layout/UpdateDialog.vue b/apps/desktop/src/components/layout/UpdateDialog.vue
index ba5ba404f5..0553dd767d 100644
--- a/apps/desktop/src/components/layout/UpdateDialog.vue
+++ b/apps/desktop/src/components/layout/UpdateDialog.vue
@@ -298,8 +298,8 @@ watch(
</DialogHeader>
<div class="flex min-h-0 flex-1 flex-col">
- <div v-if="tabs.length" class="border-b px-4 py-2">
- <div role="tablist" :aria-label="t('updates.centerTitle')" class="inline-flex h-9 w-full items-center justify-center rounded-md bg-muted p-[3px] text-muted-foreground">
+ <div v-if="tabs.length" class="px-5 pb-2.5 pt-1.5">
+ <div role="tablist" :aria-label="t('updates.centerTitle')" class="inline-flex h-9 w-full items-center gap-1">
<button
v-for="tab in tabs"
:key="tab.id"
@@ -308,8 +308,8 @@ watch(
:aria-selected="selectedTab === tab.id"
:data-state="selectedTab === tab.id ? 'active' : 'inactive'"
:data-update-tab="tab.id"
- class="relative inline-flex h-full flex-1 select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-md border border-transparent px-2 text-sm font-medium transition-colors hover:text-foreground focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50"
- :class="selectedTab === tab.id ? 'bg-background text-foreground shadow-sm' : 'text-foreground/60'"
+ class="relative inline-flex h-full select-none items-center gap-1.5 whitespace-nowrap px-2.5 text-sm font-medium transition-colors after:absolute after:inset-x-2.5 after:bottom-0 after:h-0.5 after:rounded-full after:bg-foreground after:opacity-0 after:transition-opacity hover:text-foreground focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50"
+ :class="selectedTab === tab.id ? 'text-foreground after:opacity-100' : 'text-foreground/60'"
@click="selectTab(tab.id)"
>
<span>{{ tab.label }}</span>
@@ -376,12 +376,14 @@ watch(
{{ t("updates.historyLoadFailed") }}
</div>
<template v-else>
- <div v-for="release in visibleOlderReleases" :key="release.tag" class="flex items-center justify-between gap-4 rounded-md border p-3">
- <div class="min-w-0">
- <div class="font-medium">{{ release.tag }}</div>
- <div class="mt-0.5 text-xs text-muted-foreground">{{ t("updates.historyPublishedOn", { date: formatOlderReleaseDate(release.date) }) }}</div>
+ <div class="divide-y overflow-hidden rounded-md border">
+ <div v-for="release in visibleOlderReleases" :key="release.tag" class="flex items-center justify-between gap-4 px-3 py-2">
+ <span class="min-w-0 truncate font-medium">{{ release.tag }}</span>
+ <span class="flex shrink-0 items-center gap-3">
+ <span class="text-xs text-muted-foreground">{{ t("updates.historyPublishedOn", { date: formatOlderReleaseDate(release.date) }) }}</span>
+ <Button variant="outline" class="shrink-0" @click="openOlderReleasePage(release.tag)">{{ t("updates.openRelease") }}</Button>
+ </span>
</div>
- <Button variant="outline" class="shrink-0" @click="openOlderReleasePage(release.tag)">{{ t("updates.openRelease") }}</Button>
</div>
<Button v-if="hasMoreOlderReleases" variant="ghost" class="w-full" @click="showMoreOlderReleases">{{ t("updates.historyLoadMore") }}</Button>
</template>
@@ -400,45 +402,55 @@ watch(
<span>{{ componentUpdatesError }}</span>
</div>
<template v-if="selectedTab === 'drivers'">
- <div v-for="driver in driverUpdates" :key="driver.db_type" class="flex items-center justify-between gap-4 rounded-md border p-3">
- <div class="min-w-0">
- <div class="font-medium">{{ driver.label }}</div>
- <div class="mt-0.5 text-xs text-muted-foreground">{{ driver.installed_version || driver.version }} → {{ driver.version }}</div>
+ <div v-if="driverUpdates.length" class="divide-y overflow-hidden rounded-md border">
+ <div v-for="driver in driverUpdates" :key="driver.db_type" data-update-entry class="flex items-center justify-between gap-4 px-3 py-2">
+ <span class="min-w-0 truncate font-medium">{{ driver.label }}</span>
+ <span class="flex shrink-0 items-center gap-3">
+ <span class="text-xs tabular-nums text-muted-foreground">{{ driver.installed_version || driver.version }} → {{ driver.version }}</span>
+ <span class="rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary">{{ t("settings.updateAvailable") }}</span>
+ </span>
</div>
- <span class="shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary">{{ t("settings.updateAvailable") }}</span>
</div>
</template>
<template v-else-if="selectedTab === 'jdbc' && jdbcUpdate?.update_available">
- <div class="flex items-center justify-between gap-4 rounded-md border p-3">
- <div class="min-w-0">
- <div class="font-medium">{{ t("settings.updateJdbc") }}</div>
- <div class="mt-0.5 text-xs text-muted-foreground">{{ jdbcUpdate.version || t("updates.notInstalled") }} → {{ jdbcUpdate.latest_version || t("settings.updateAvailable") }}</div>
+ <div class="divide-y overflow-hidden rounded-md border">
+ <div data-update-entry class="flex items-center justify-between gap-4 px-3 py-2">
+ <span class="min-w-0 truncate font-medium">{{ t("settings.updateJdbc") }}</span>
+ <span class="flex shrink-0 items-center gap-3">
+ <span class="text-xs tabular-nums text-muted-foreground">{{ jdbcUpdate.version || t("updates.notInstalled") }} → {{ jdbcUpdate.latest_version || t("settings.updateAvailable") }}</span>
+ <span class="rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary">{{ t("settings.updateAvailable") }}</span>
+ </span>
</div>
- <span class="shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary">{{ t("settings.updateAvailable") }}</span>
</div>
</template>
<template v-else-if="selectedTab === 'mcp' && mcpAvailable && mcpUpdate">
- <div class="flex items-center justify-between gap-4 rounded-md border p-3">
- <div class="min-w-0">
- <div class="font-medium">{{ t("settings.updateMcp") }}</div>
- <div class="mt-0.5 text-xs text-muted-foreground">{{ mcpUpdate.current_version || t("updates.notInstalled") }} → {{ mcpUpdate.latest_version || t("settings.updateAvailable") }}</div>
+ <div class="divide-y overflow-hidden rounded-md border">
+ <div data-update-entry class="flex items-center justify-between gap-4 px-3 py-2">
+ <span class="min-w-0 truncate font-medium">{{ t("settings.updateMcp") }}</span>
+ <span class="flex shrink-0 items-center gap-3">
+ <span class="text-xs tabular-nums text-muted-foreground">{{ mcpUpdate.current_version || t("updates.notInstalled") }} → {{ mcpUpdate.latest_version || t("settings.updateAvailable") }}</span>
+ <span class="rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary">{{ t("settings.updateAvailable") }}</span>
+ </span>
</div>
- <span class="shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary">{{ t("settings.updateAvailable") }}</span>
</div>
</template>
<template v-else-if="selectedTab === 'plugins'">
- <div v-for="plugin in pluginUpdates" :key="plugin.key" class="flex items-center justify-between gap-4 rounded-md border p-3">
- <div class="min-w-0">
- <div class="truncate font-medium">{{ plugin.name }}</div>
- <div class="mt-0.5 text-xs text-muted-foreground">{{ plugin.installed?.manifest.version || t("updates.notInstalled") }} → {{ plugin.plugin.latestVersion }}</div>
+ <div class="divide-y overflow-hidden rounded-md border">
+ <div v-for="plugin in pluginUpdates" :key="plugin.key" data-update-entry class="px-3 py-2">
+ <div class="flex items-center justify-between gap-4">
+ <span class="min-w-0 truncate font-medium">{{ plugin.name }}</span>
+ <span class="flex shrink-0 items-center gap-3">
+ <span class="text-xs tabular-nums text-muted-foreground">{{ plugin.installed?.manifest.version || t("updates.notInstalled") }} → {{ plugin.plugin.latestVersion }}</span>
+ <span class="rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary">{{ t("settings.updateAvailable") }}</span>
+ </span>
+ </div>
<!-- "Update all" deliberately skips a changed source: the user has to confirm it in
the Plugin Center, so say so instead of leaving an item that never updates. -->
<div v-if="pluginSourceChange(plugin)" class="mt-1 text-xs text-amber-600 dark:text-amber-400">{{ t("pluginPlatform.updateSourceChangeRequired") }}</div>
</div>
- <span class="shrink-0 rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary">{{ t("settings.updateAvailable") }}</span>
</div>
</template>
diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.ts
index 8c0d7111c5..7cb5c070b2 100644
--- a/apps/desktop/src/i18n/locales/zh-CN.ts
+++ b/apps/desktop/src/i18n/locales/zh-CN.ts
@@ -7907,7 +7907,7 @@ export default withEnglishFallback({
checkUpdates: "立即检查",
updateAll: "一键更新",
updateClient: "DBX",
- updateDrivers: "数据库驱动",
+ updateDrivers: "驱动",
updateJdbc: "JDBC",
updateMcp: "MCP",
updatePlugins: "插件",
diff --git a/apps/desktop/src/i18n/locales/zh-TW.ts b/apps/desktop/src/i18n/locales/zh-TW.ts
index 088d5eae3f..3e9e308ab5 100644
--- a/apps/desktop/src/i18n/locales/zh-TW.ts
+++ b/apps/desktop/src/i18n/locales/zh-TW.ts
@@ -6558,7 +6558,7 @@ export default withEnglishFallback({
checkUpdates: "立即檢查",
updateAll: "更新全部",
updateClient: "DBX",
- updateDrivers: "資料庫驅動程式",
+ updateDrivers: "驅動程式",
updateJdbc: "JDBC",
updateMcp: "MCP",
updatePlugins: "外掛",