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。

fix(connection): show global timeout help on Windows

zipgca8f6cd9677b
diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue
index bdab408317..582797ef45 100644
--- a/apps/desktop/src/components/connection/ConnectionDialog.vue
+++ b/apps/desktop/src/components/connection/ConnectionDialog.vue
@@ -8154,14 +8154,9 @@ function openExternalUrl(url: string) {
<input id="connect-timeout-global" v-model="form.connect_timeout_inherit" type="radio" name="connect-timeout-scope" :value="true" class="h-3.5 w-3.5 shrink-0 accent-primary" />
<div class="flex min-w-0 flex-1 items-center gap-1">
<label for="connect-timeout-global" class="min-w-0 cursor-pointer truncate text-xs" :title="t('connection.useGlobalQueryTimeout')">{{ t("connection.useGlobalQueryTimeout") }}</label>
- <Tooltip>
- <TooltipTrigger as-child>
- <CircleHelp class="h-3.5 w-3.5 shrink-0 cursor-help text-muted-foreground hover:text-foreground" />
- </TooltipTrigger>
- <TooltipContent side="top" align="center" class="max-w-[280px] text-xs leading-relaxed">
- {{ t("connection.globalConnectTimeoutHint") }}
- </TooltipContent>
- </Tooltip>
+ <HelpTooltip :label="t('connection.globalConnectTimeoutHint')" content-class="max-w-[280px]">
+ {{ t("connection.globalConnectTimeoutHint") }}
+ </HelpTooltip>
</div>
<Input
v-model.number="editGlobalConnectTimeoutSecs"
@@ -8204,14 +8199,9 @@ function openExternalUrl(url: string) {
<input id="query-timeout-global" v-model="form.query_timeout_inherit" type="radio" name="query-timeout-scope" :value="true" class="h-3.5 w-3.5 shrink-0 accent-primary" />
<div class="flex min-w-0 flex-1 items-center gap-1">
<label for="query-timeout-global" class="min-w-0 cursor-pointer truncate text-xs" :title="t('connection.useGlobalQueryTimeout')">{{ t("connection.useGlobalQueryTimeout") }}</label>
- <Tooltip>
- <TooltipTrigger as-child>
- <CircleHelp class="h-3.5 w-3.5 shrink-0 cursor-help text-muted-foreground hover:text-foreground" />
- </TooltipTrigger>
- <TooltipContent side="top" align="center" class="max-w-[280px] text-xs leading-relaxed">
- {{ t("connection.globalQueryTimeoutHint") }}
- </TooltipContent>
- </Tooltip>
+ <HelpTooltip :label="t('connection.globalQueryTimeoutHint')" content-class="max-w-[280px]">
+ {{ t("connection.globalQueryTimeoutHint") }}
+ </HelpTooltip>
</div>
<Input v-model.number="editGlobalQueryTimeoutSecs" type="number" min="0" :max="MAX_QUERY_TIMEOUT_SECS" step="1" class="col-span-2 h-7 w-full shrink-0 sm:col-span-1 sm:w-20" :disabled="form.query_timeout_inherit !== true" @input="clampQueryTimeoutInput($event, 'global')" />
</div>
diff --git a/apps/desktop/src/lib/__tests__/connection/connectionDialogTimeouts.spec.ts b/apps/desktop/src/lib/__tests__/connection/connectionDialogTimeouts.spec.ts
index 0a6bd458c7..3b86f91b45 100644
--- a/apps/desktop/src/lib/__tests__/connection/connectionDialogTimeouts.spec.ts
+++ b/apps/desktop/src/lib/__tests__/connection/connectionDialogTimeouts.spec.ts
@@ -25,8 +25,13 @@ describe("ConnectionDialog timeout controls", () => {
expect(dialogSource).not.toContain("Number(config.connect_timeout_secs)");
});
- it("shows range help beside both global timeout labels", () => {
- expect(dialogSource).toContain('t("connection.globalConnectTimeoutHint")');
- expect(dialogSource).toContain('t("connection.globalQueryTimeoutHint")');
+ it("uses button-backed help tooltips beside both global timeout labels", () => {
+ const connectGlobalControl = dialogSource.slice(dialogSource.indexOf('id="connect-timeout-global"'), dialogSource.indexOf('id="connect-timeout-connection"'));
+ const queryGlobalControl = dialogSource.slice(dialogSource.indexOf('id="query-timeout-global"'), dialogSource.indexOf('id="query-timeout-connection"'));
+
+ expect(connectGlobalControl).toContain(`<HelpTooltip :label="t('connection.globalConnectTimeoutHint')"`);
+ expect(queryGlobalControl).toContain(`<HelpTooltip :label="t('connection.globalQueryTimeoutHint')"`);
+ expect(connectGlobalControl).not.toContain("<TooltipTrigger");
+ expect(queryGlobalControl).not.toContain("<TooltipTrigger");
});
});