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。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
fix(support-info): show Windows marketing name in support info
弈秋79d172fcff36
diff --git a/apps/desktop/src/lib/app/supportInfo.ts b/apps/desktop/src/lib/app/supportInfo.tsindex c4bac799e1..f423484df1 100644--- a/apps/desktop/src/lib/app/supportInfo.ts+++ b/apps/desktop/src/lib/app/supportInfo.ts@@ -32,10 +32,33 @@ export function formatSupportInfoRuntime(runtime: AppSupportInfo["runtime"], labreturn labels.unknown;}+/**+ * Map a Windows NT kernel version (`major.minor.build[.ubr]`) to its marketing name.+ *+ * Windows 11 still reports kernel `10.0.x`; the build number is what distinguishes it+ * (build >= 22000 is Windows 11). Returns null for non-`10.0` versions (e.g. legacy 6.x)+ * so callers keep the raw string instead of guessing.+ */+export function windowsMarketingName(version: string | null | undefined): string | null {+ const trimmed = version?.trim();+ if (!trimmed) return null;+ const parts = trimmed.split(".");+ if (parts.length < 3) return null;+ const major = Number(parts[0]);+ const build = Number(parts[2]);+ if (!Number.isInteger(major) || !Number.isInteger(build)) return null;+ if (major !== 10) return null;+ return build >= 22000 ? "Windows 11" : "Windows 10";+}+export function formatSupportInfoOperatingSystem(info: AppSupportInfo, unknownLabel: string): string {const name = info.osName?.trim();const version = info.osVersion?.trim();if (!name && !version) return unknownLabel;+ if (name?.toLowerCase() === "windows") {+ const marketing = windowsMarketingName(version);+ if (marketing) return version ? `${marketing} (${version})` : marketing;+ }return [name, version].filter(Boolean).join(" ");}diff --git a/packages/app-tests/supportInfo.test.ts b/packages/app-tests/supportInfo.test.tsindex 82c247d521..7c1dbd34f7 100644--- a/packages/app-tests/supportInfo.test.ts+++ b/packages/app-tests/supportInfo.test.ts@@ -1,6 +1,6 @@import { strict as assert } from "node:assert";import { test } from "vitest";-import { buildAppSupportInfoRows, formatAppSupportInfoForClipboard, normalizeSupportInfoVersion } from "../../apps/desktop/src/lib/app/supportInfo.ts";+import { buildAppSupportInfoRows, formatAppSupportInfoForClipboard, formatSupportInfoOperatingSystem, normalizeSupportInfoVersion, windowsMarketingName } from "../../apps/desktop/src/lib/app/supportInfo.ts";import type { AppSupportInfoLabels } from "../../apps/desktop/src/lib/app/supportInfo.ts";import type { AppSupportInfo } from "../../apps/desktop/src/lib/backend/tauri.ts";@@ -49,3 +49,34 @@ test("formats support info clipboard text in stable issue-friendly order", () =>["DBX Version: v0.5.50", "Runtime: Desktop", "Operating System: macOS 15.5", "Architecture: aarch64"].join("\n"),);});++test("maps Windows kernel build to its marketing name", () => {+ assert.equal(windowsMarketingName("10.0.26200.9457"), "Windows 11");+ assert.equal(windowsMarketingName("10.0.22000.1"), "Windows 11");+ assert.equal(windowsMarketingName("10.0.19045.5011"), "Windows 10");+ assert.equal(windowsMarketingName("6.1.7601"), null);+ assert.equal(windowsMarketingName(""), null);+ assert.equal(windowsMarketingName("10.0"), null);+});++test("shows Windows marketing name while keeping the raw build for diagnostics", () => {+ assert.equal(+ formatSupportInfoOperatingSystem({ appVersion: "0.6.22", runtime: "desktop", osName: "Windows", osVersion: "10.0.26200.9457", arch: "x86_64" }, labels.unknown),+ "Windows 11 (10.0.26200.9457)",+ );+ assert.equal(+ formatSupportInfoOperatingSystem({ appVersion: "0.6.22", runtime: "desktop", osName: "Windows", osVersion: "10.0.19045.5011", arch: "x64" }, labels.unknown),+ "Windows 10 (10.0.19045.5011)",+ );+});++test("leaves non-10.0 Windows and other platforms unchanged", () => {+ assert.equal(+ formatSupportInfoOperatingSystem({ appVersion: "x", runtime: "desktop", osName: "Windows", osVersion: "6.1.7601", arch: "x86" }, labels.unknown),+ "Windows 6.1.7601",+ );+ assert.equal(+ formatSupportInfoOperatingSystem({ appVersion: "x", runtime: "desktop", osName: "macOS", osVersion: "15.5", arch: "aarch64" }, labels.unknown),+ "macOS 15.5",+ );+});