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
feat(docs): add offline driver downloads
t8y219139a9b3414
diff --git a/README.md b/README.mdindex abf06f1e7c..83ec321808 100644--- a/README.md+++ b/README.md@@ -284,7 +284,7 @@ No. DBX does not collect telemetry. The auto-update feature checks GitHub Releas<details><summary><strong>Can I use DBX without an internet connection?</strong></summary>-Yes. The desktop app works fully offline. AI features need network access to the model endpoint (or a local model via Ollama).+Yes. The desktop app works fully offline. For air-gapped driver installs, download offline driver packages from the [Offline Drivers page](https://dbxio.com/en/drivers) on an internet-connected machine, transfer them to the offline machine, then import them in DBX from Settings > Driver Manager. AI features need network access to the model endpoint (or a local model via Ollama).</details><details>diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 557dd6c51a..a1ecba291a 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -284,7 +284,7 @@ pnpm tauri build<details><summary><strong>可以离线使用吗?</strong></summary>-可以。桌面端完全支持离线使用。AI 功能需要网络访问模型端点(或通过 Ollama 使用本地模型)。+可以。桌面端完全支持离线使用。内网环境安装驱动时,可在有网机器打开[离线驱动下载页](https://dbxio.com/cn/drivers)下载离线驱动包,传输到内网机器后,在 DBX 的「设置 > 驱动管理」中导入。AI 功能需要网络访问模型端点(或通过 Ollama 使用本地模型)。</details><details>diff --git a/apps/desktop/src/components/config/DriverStoreDialog.vue b/apps/desktop/src/components/config/DriverStoreDialog.vueindex 32f353aa92..5e7e7e8735 100644--- a/apps/desktop/src/components/config/DriverStoreDialog.vue+++ b/apps/desktop/src/components/config/DriverStoreDialog.vue@@ -3,9 +3,11 @@ import { ref, onMounted, onUnmounted, computed, watch } from "vue";import { useI18n } from "vue-i18n";import {Activity,+ ExternalLink,Cpu,FolderOpen,MemoryStick,+ Search,Square,Trash2,Download,@@ -74,6 +76,7 @@ const driverStoreTab = ref("agent");// ──────────── Agent drivers ────────────const drivers = ref<AgentDriverInfo[]>([]);+const agentDriverSearch = ref("");const installing = ref<string | null>(null);const upgradingAll = ref(false);const upgradingCurrent = ref("");@@ -93,6 +96,7 @@ const runtimeError = ref("");const runtimeBusy = ref<string | null>(null);let runtimeTimer: ReturnType<typeof setInterval> | null = null;const DRIVER_RUNTIME_POLL_MS = 5000;+const OFFLINE_DRIVER_DOWNLOAD_URL = "https://dbxio.com/cn/drivers";let unlisten: (() => void) | null = null;@@ -189,6 +193,15 @@ function canInstallOrUpdateDriver(dbType: string): boolean {return Boolean(driver && (!driver.installed || driver.update_available));}+async function openOfflineDriverDownload() {+ if (isWeb) {+ window.open(OFFLINE_DRIVER_DOWNLOAD_URL, "_blank", "noopener,noreferrer");+ return;+ }+ const { open } = await import("@tauri-apps/plugin-shell");+ await open(OFFLINE_DRIVER_DOWNLOAD_URL);+}+function queueDriverInstall(dbType: string) {queuedDriverInstalls.value = addDriverInstallQueue(queuedDriverInstalls.value, dbType, installing.value);}@@ -470,12 +483,33 @@ function formatSize(bytes: number): string {// ──────────── JDBC drivers ────────────const jdbcDrivers = ref<JdbcDriverInfo[]>([]);+const jdbcDriverSearch = ref("");const isLoadingJdbcDrivers = ref(false);const jdbcPluginStatus = ref<JdbcPluginStatus | null>(null);const isInstallingJdbcPlugin = ref(false);const isUninstallingJdbcPlugin = ref(false);const jdbcDriverPathInput = ref("");+const filteredAgentDrivers = computed(() => {+ const query = agentDriverSearch.value.trim().toLowerCase();+ if (!query) return drivers.value;+ return drivers.value.filter((driver) =>+ [driver.label, driver.db_type, driver.version, driver.installed_version, driver.jre]+ .filter(Boolean)+ .join(" ")+ .toLowerCase()+ .includes(query),+ );+});++const filteredJdbcDrivers = computed(() => {+ const query = jdbcDriverSearch.value.trim().toLowerCase();+ if (!query) return jdbcDrivers.value;+ return jdbcDrivers.value.filter((driver) =>+ [driver.name, driver.path, String(driver.size)].join(" ").toLowerCase().includes(query),+ );+});+function formatBytes(bytes: number) {if (bytes < 1024) return `${bytes} B`;if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;@@ -803,6 +837,22 @@ watch(driverStoreTab, (tab) => {<div class="mt-0.5 text-xs font-medium">{{ formatBytes(item.bytes) }}</div></div></div>+ <div class="mt-3 rounded-lg border bg-background/50 px-2.5 py-2">+ <div class="flex items-center justify-between gap-3">+ <div class="min-w-0 truncate text-xs text-muted-foreground">+ {{ t("driverStore.offlineDownloadHint") }}+ </div>+ <Button+ variant="outline"+ size="sm"+ class="h-7 shrink-0 rounded-full text-xs gap-1 whitespace-nowrap"+ @click="openOfflineDriverDownload"+ >+ <ExternalLink class="h-3.5 w-3.5" />+ {{ t("driverStore.offlineDownloadLink") }}+ </Button>+ </div>+ </div></div><div class="flex items-center justify-between">@@ -845,114 +895,132 @@ watch(driverStoreTab, (tab) => {<!-- Agent Tab --><TabsContent value="agent" class="mt-5 space-y-5">- <!-- Java Runtime Mode -->+ <!-- Java Runtime --><div class="rounded-xl border bg-muted/20 p-4 space-y-3">- <div class="flex flex-wrap items-end gap-3">- <div class="min-w-[220px] flex-1 space-y-1.5">- <Label>{{ t("driverStore.javaRuntime") }}</Label>- <Select :model-value="javaRuntimeConfig.mode" @update:model-value="setJavaRuntimeMode">- <SelectTrigger class="h-8 text-xs">- <SelectValue />- </SelectTrigger>- <SelectContent>- <SelectItem value="managed">{{ t("driverStore.javaRuntimeManaged") }}</SelectItem>- <SelectItem value="system">{{ t("driverStore.javaRuntimeSystem") }}</SelectItem>- <SelectItem value="custom">{{ t("driverStore.javaRuntimeCustom") }}</SelectItem>- </SelectContent>- </Select>- </div>- <Button- class="h-8 shrink-0 rounded-full text-xs"- :disabled="savingJavaRuntime || (javaRuntimeConfig.mode === 'custom' && !customJavaPath.trim())"- @click="saveJavaRuntimeConfig"- >- {{ savingJavaRuntime ? t("driverStore.saving") : t("settings.save") }}- </Button>- </div>- <div v-if="javaRuntimeConfig.mode === 'custom'" class="flex items-center gap-2">+ <div class="flex flex-wrap items-center gap-2">+ <Label class="shrink-0">{{ t("driverStore.javaRuntime") }}</Label>+ <Select :model-value="javaRuntimeConfig.mode" @update:model-value="setJavaRuntimeMode">+ <SelectTrigger class="h-8 min-w-[112px] text-xs">+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value="managed">{{ t("driverStore.javaRuntimeManaged") }}</SelectItem>+ <SelectItem value="system">{{ t("driverStore.javaRuntimeSystem") }}</SelectItem>+ <SelectItem value="custom">{{ t("driverStore.javaRuntimeCustom") }}</SelectItem>+ </SelectContent>+ </Select><Input+ v-if="javaRuntimeConfig.mode === 'custom'"v-model="customJavaPath"- class="h-8 flex-1 text-xs"+ class="h-8 min-w-[180px] flex-1 text-xs":placeholder="t('driverStore.customJavaPathPlaceholder')"@keydown.enter.prevent="saveJavaRuntimeConfig"/>- <Button variant="outline" class="h-8 shrink-0 rounded-full text-xs" @click="chooseCustomJavaPath">+ <span v-else class="min-w-0 flex-1 truncate text-xs text-muted-foreground">+ {{+ javaRuntimeConfig.mode === "system"+ ? t("driverStore.systemJavaHint")+ : t("driverStore.jreRuntimeAutoDownloadHint")+ }}+ </span>+ <Button+ v-if="javaRuntimeConfig.mode === 'custom'"+ variant="outline"+ class="h-8 shrink-0 rounded-full text-xs"+ @click="chooseCustomJavaPath"+ ><FolderOpen class="h-3.5 w-3.5" />{{ t("driverStore.choose") }}</Button>+ <Button+ class="h-8 shrink-0 rounded-full text-xs"+ :disabled="savingJavaRuntime || (javaRuntimeConfig.mode === 'custom' && !customJavaPath.trim())"+ @click="saveJavaRuntimeConfig"+ >+ {{ savingJavaRuntime ? t("driverStore.saving") : t("settings.save") }}+ </Button></div>- <p v-else-if="javaRuntimeConfig.mode === 'system'" class="text-xs text-muted-foreground">- {{ t("driverStore.systemJavaHint") }}- </p>- </div>- <!-- JRE Runtime -->- <div v-if="installedJres.length > 0" class="rounded-xl border bg-muted/20 p-4 space-y-2.5">- <div v-for="jre in installedJres" :key="jre.key" class="flex items-center justify-between gap-3">- <div class="min-w-0">- <div class="text-sm font-medium">{{ t("driverStore.jreRuntimeTitle", { jre: jre.key }) }}</div>- </div>- <div class="flex shrink-0 items-center gap-3">- <span- v-if="jreUsageLabel(jre.key)"- class="rounded-full bg-muted px-2 py-0.5 text-[11px] text-muted-foreground"- >- {{ jreUsageLabel(jre.key) }}- </span>- <Check v-if="jre.installed" class="h-4 w-4 text-green-600" />- <span v-else class="text-xs text-muted-foreground">{{ t("driverStore.notInstalled") }}</span>- <DriverInstallProgressCircle- v-if="reinstallingJre === jre.key"- :percent="progressNumber"- :title="progressTitle(jre.installed ? t('driverStore.reinstalling') : t('driverStore.installing'))"- />- <Button- v-else-if="!jre.installed"- type="button"- variant="default"- size="sm"- class="h-8 rounded-full text-xs"- :disabled="reinstallingJre !== null || installing !== null"- @click="reinstallJre(jre.key)"- >- <Download class="h-3.5 w-3.5 mr-1" />- {{ t("driverStore.install") }}- </Button>- <Button- v-else-if="jre.installed"- type="button"- variant="outline"- size="sm"- class="h-8 rounded-full text-xs"- :disabled="reinstallingJre !== null || installing !== null"- @click="reinstallJre(jre.key)"- >- <RotateCcw class="h-3.5 w-3.5 mr-1" />- {{ t("driverStore.reinstall") }}- </Button>- <Button- v-if="jre.installed"- type="button"- variant="ghost"- size="sm"- class="h-8 rounded-full text-xs text-muted-foreground hover:text-destructive"- :disabled="reinstallingJre !== null || installing !== null"- @click="uninstallJre(jre.key)"- >- {{ t("driverStore.uninstall") }}- </Button>+ <div v-if="installedJres.length > 0" class="divide-y rounded-lg border bg-background/50">+ <div+ v-for="jre in installedJres"+ :key="jre.key"+ class="flex items-center justify-between gap-3 px-3 py-2.5"+ >+ <div class="min-w-0">+ <div class="text-sm font-medium">{{ t("driverStore.jreRuntimeTitle", { jre: jre.key }) }}</div>+ </div>+ <div class="flex shrink-0 items-center gap-3">+ <span+ v-if="jreUsageLabel(jre.key)"+ class="rounded-full bg-muted px-2 py-0.5 text-[11px] text-muted-foreground"+ >+ {{ jreUsageLabel(jre.key) }}+ </span>+ <Check v-if="jre.installed" class="h-4 w-4 text-green-600" />+ <span v-else class="text-xs text-muted-foreground">{{ t("driverStore.notInstalled") }}</span>+ <DriverInstallProgressCircle+ v-if="reinstallingJre === jre.key"+ :percent="progressNumber"+ :title="+ progressTitle(jre.installed ? t('driverStore.reinstalling') : t('driverStore.installing'))+ "+ />+ <Button+ v-else-if="!jre.installed"+ type="button"+ variant="default"+ size="sm"+ class="h-8 rounded-full text-xs"+ :disabled="reinstallingJre !== null || installing !== null"+ @click="reinstallJre(jre.key)"+ >+ <Download class="h-3.5 w-3.5 mr-1" />+ {{ t("driverStore.install") }}+ </Button>+ <Button+ v-else-if="jre.installed"+ type="button"+ variant="outline"+ size="sm"+ class="h-8 rounded-full text-xs"+ :disabled="reinstallingJre !== null || installing !== null"+ @click="reinstallJre(jre.key)"+ >+ <RotateCcw class="h-3.5 w-3.5 mr-1" />+ {{ t("driverStore.reinstall") }}+ </Button>+ <Button+ v-if="jre.installed"+ type="button"+ variant="ghost"+ size="sm"+ class="h-8 rounded-full text-xs text-muted-foreground hover:text-destructive"+ :disabled="reinstallingJre !== null || installing !== null"+ @click="uninstallJre(jre.key)"+ >+ {{ t("driverStore.uninstall") }}+ </Button>+ </div></div></div></div>- <div v-else class="rounded-xl border bg-muted/20 p-4">- <div class="text-sm font-medium">{{ t("driverStore.jreRuntime") }}</div>- <p class="text-xs text-muted-foreground mt-0.5">{{ t("driverStore.jreRuntimeAutoDownloadHint") }}</p>- </div><!-- Driver List -->+ <div class="relative">+ <Search class="absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" />+ <Input+ v-model="agentDriverSearch"+ class="h-8 pl-8 text-xs"+ :placeholder="t('driverStore.searchDrivers')"+ />+ </div><div v-if="drivers.length === 0" class="py-12 text-center text-sm text-muted-foreground">{{ t("common.loading") }}</div>+ <div v-else-if="filteredAgentDrivers.length === 0" class="py-12 text-center text-sm text-muted-foreground">+ {{ t("driverStore.noMatchingDrivers") }}+ </div><div v-else class="rounded-md border divide-y"><div v-if="updatableCount > 0" class="flex items-center justify-between px-4 py-2 bg-muted/30"><span class="text-xs text-muted-foreground">{{@@ -974,7 +1042,7 @@ watch(driverStoreTab, (tab) => {</Button></div><div- v-for="driver in drivers"+ v-for="driver in filteredAgentDrivers":key="driver.db_type"class="flex items-center gap-3 px-4 py-2.5 transition hover:bg-muted/30">@@ -1180,6 +1248,14 @@ watch(driverStoreTab, (tab) => {<div class="space-y-1"><Label>{{ t("settings.jdbcDrivers") }}</Label></div>+ <div class="relative">+ <Search class="absolute left-3 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" />+ <Input+ v-model="jdbcDriverSearch"+ class="h-8 pl-8 text-xs"+ :placeholder="t('driverStore.searchJdbcDrivers')"+ />+ </div><div class="flex items-center gap-2"><Inputv-model="jdbcDriverPathInput"@@ -1209,8 +1285,11 @@ watch(driverStoreTab, (tab) => {<div v-else-if="jdbcDrivers.length === 0" class="p-4 text-sm text-muted-foreground">{{ t("settings.jdbcNoDrivers") }}</div>+ <div v-else-if="filteredJdbcDrivers.length === 0" class="p-4 text-sm text-muted-foreground">+ {{ t("driverStore.noMatchingDrivers") }}+ </div><div v-else class="divide-y">- <div v-for="driver in jdbcDrivers" :key="driver.path" class="flex items-center gap-3 p-3">+ <div v-for="driver in filteredJdbcDrivers" :key="driver.path" class="flex items-center gap-3 p-3"><div class="min-w-0 flex-1"><div class="truncate text-sm font-medium">{{ driver.name }}</div><div class="truncate text-xs text-muted-foreground">{{ driver.path }}</div>diff --git a/apps/desktop/src/i18n/locales/en.ts b/apps/desktop/src/i18n/locales/en.tsindex 7e730188e9..4f73946c51 100644--- a/apps/desktop/src/i18n/locales/en.ts+++ b/apps/desktop/src/i18n/locales/en.ts@@ -1976,6 +1976,12 @@ export default {usageAgentDrivers: "Built-in driver agents",usageJdbcPlugin: "JDBC plugin",usageJdbcDriverJars: "JDBC driver JARs",+ offlineDownloadHint:+ "For air-gapped environments, download offline driver packages on an internet-connected machine, then import them here.",+ offlineDownloadLink: "Offline driver downloads",+ searchDrivers: "Search driver name, type, version...",+ searchJdbcDrivers: "Search JDBC driver name or path...",+ noMatchingDrivers: "No matching drivers.",javaRuntimeSaved: "Java runtime settings saved",javaRuntimeSaveFailed: "Failed to save Java runtime settings: {error}",chooseJavaExecutable: "Choose Java executable",diff --git a/apps/desktop/src/i18n/locales/zh-CN.ts b/apps/desktop/src/i18n/locales/zh-CN.tsindex e87d6946c9..dd702dde84 100644--- a/apps/desktop/src/i18n/locales/zh-CN.ts+++ b/apps/desktop/src/i18n/locales/zh-CN.ts@@ -1929,6 +1929,11 @@ export default {usageAgentDrivers: "内置驱动 Agent",usageJdbcPlugin: "JDBC 插件",usageJdbcDriverJars: "JDBC 驱动 JAR",+ offlineDownloadHint: "内网环境可先在有网机器下载离线驱动包,再回到这里导入。",+ offlineDownloadLink: "离线驱动下载",+ searchDrivers: "搜索驱动名称、类型、版本...",+ searchJdbcDrivers: "搜索 JDBC 驱动名称或路径...",+ noMatchingDrivers: "没有匹配的驱动。",javaRuntimeSaved: "Java 运行时设置已保存",javaRuntimeSaveFailed: "Java 运行时设置失败: {error}",chooseJavaExecutable: "选择 Java 可执行文件",diff --git a/docs/app/[lang]/drivers/DriversClient.tsx b/docs/app/[lang]/drivers/DriversClient.tsxnew file mode 100644index 0000000000..95fb74088c--- /dev/null+++ b/docs/app/[lang]/drivers/DriversClient.tsx@@ -0,0 +1,361 @@+"use client";++import { useCallback, useEffect, useMemo, useState } from "react";+import { useParams } from "next/navigation";+import { LandingNav } from "@/components/landing/LandingNav";+import {+ buildDriverEntries,+ buildJreEntries,+ fetchAgentRegistry,+ formatSize,+ type AgentRegistry,+ type JreDisplayEntry,+} from "@/lib/agentRegistry";+import { AlertTriangle, Cpu, Database, Download, Loader2, Search, X } from "lucide-react";++const i18n = {+ en: {+ title: "Offline Driver Downloads",+ subtitle:+ "Download database drivers and JRE packages for offline use. Search for the exact resource your air-gapped environment needs.",+ drivers: "Database Drivers",+ driversDesc: "JDBC driver JAR files for each supported database type.",+ jre: "Java Runtime (JRE)",+ jreDesc:+ "JRE packages used by agent-based database drivers. Required for Oracle, SQL Server, and other agent-managed connections.",+ loading: "Loading driver catalog...",+ error: "Unable to load driver catalog. Please check your network connection.",+ retry: "Retry",+ download: "Download",+ version: "Version",+ size: "Size",+ requiresJre: "Requires JRE",+ platform: "Platform",+ search: "Search drivers, platforms, versions...",+ noResults: "No matching downloads.",+ showing: "Showing",+ of: "of",+ clearSearch: "Clear search",+ downloadHint:+ "For air-gapped environments: download these files on an internet-connected machine, then transfer them to the offline machine and import them in DBX from Settings > Driver Manager.",+ },+ cn: {+ title: "离线驱动下载",+ subtitle: "下载数据库驱动和 JRE 离线包。搜索内网环境需要的资源,在有网机器下载后传输。",+ drivers: "数据库驱动",+ driversDesc: "每种支持的数据库类型对应的 JDBC 驱动 JAR 文件。",+ jre: "Java 运行时 (JRE)",+ jreDesc: "Agent 驱动所需的 JRE 环境,Oracle、SQL Server 等数据库通过 Agent 连接时需要。",+ loading: "正在加载驱动列表...",+ error: "加载驱动列表失败,请检查网络连接。",+ retry: "重试",+ download: "下载",+ version: "版本",+ size: "大小",+ requiresJre: "依赖 JRE",+ platform: "平台",+ search: "搜索驱动、平台、版本...",+ noResults: "没有匹配的下载项。",+ showing: "显示",+ of: "/",+ clearSearch: "清空搜索",+ downloadHint: "内网环境使用说明:在有网的电脑上下载这些文件,然后传输到内网机器,在 DBX 的“设置 > 驱动管理”中导入。",+ },+};++type ActiveTab = "drivers" | "jre";++function platformKey(j: JreDisplayEntry): string {+ return `${j.jreKey}-${j.platformKey}`;+}++function matchesSearch(values: Array<string | number | undefined>, query: string): boolean {+ if (!query) return true;+ return values.filter(Boolean).join(" ").toLowerCase().includes(query);+}++export function DriversClient() {+ const params = useParams();+ const rawLang = params?.lang as string | undefined;+ const lang: "en" | "cn" = rawLang === "cn" ? "cn" : "en";+ const t = i18n[lang];++ const [registry, setRegistry] = useState<AgentRegistry | null>(null);+ const [loading, setLoading] = useState(true);+ const [error, setError] = useState<string | null>(null);+ const [activeTab, setActiveTab] = useState<ActiveTab>("drivers");+ const [searchQuery, setSearchQuery] = useState("");++ const loadRegistry = useCallback(async () => {+ setLoading(true);+ setError(null);+ try {+ const data = await fetchAgentRegistry();+ if (data) {+ setRegistry(data);+ } else {+ setError("Unable to load driver catalog");+ }+ } catch {+ setError("Unable to load driver catalog");+ } finally {+ setLoading(false);+ }+ }, []);++ useEffect(() => {+ loadRegistry();+ }, [loadRegistry]);++ const drivers = useMemo(() => (registry ? buildDriverEntries(registry) : []), [registry]);+ const jres = useMemo(() => (registry ? buildJreEntries(registry) : []), [registry]);+ const normalizedSearch = searchQuery.trim().toLowerCase();++ const filteredDrivers = useMemo(+ () =>+ drivers.filter((d) =>+ matchesSearch([d.label, d.key, d.version, d.jre, formatSize(d.jar.size)], normalizedSearch),+ ),+ [drivers, normalizedSearch],+ );++ const filteredJres = useMemo(+ () =>+ jres.filter((j) =>+ matchesSearch(+ [j.platformLabel, j.platformKey, j.jreVersion, j.jreKey, formatSize(j.info.size)],+ normalizedSearch,+ ),+ ),+ [jres, normalizedSearch],+ );++ const activeCount = activeTab === "drivers" ? filteredDrivers.length : filteredJres.length;+ const activeTotal = activeTab === "drivers" ? drivers.length : jres.length;++ return (+ <main className="landing">+ <LandingNav lang={lang} active="drivers" />++ <section className="pt-[100px] pb-8 max-[760px]:pt-[80px] max-[760px]:pb-6">+ <div className="max-w-[1180px] mx-auto px-7 max-[760px]:px-[18px]">+ <div className="grid justify-items-center max-w-[900px] mx-auto text-center">+ <p className="min-w-0 mx-auto text-[15px] font-[460] leading-[1.7] text-landing-muted max-w-[760px] max-[760px]:text-[13px] max-[760px]:whitespace-normal max-[760px]:max-w-[300px]">+ {t.subtitle}+ </p>+ </div>+ </div>+ </section>++ <section className="max-w-[1180px] mx-auto px-7 pb-20 max-[760px]:px-[18px]">+ {loading && (+ <div className="flex items-center justify-center gap-3 py-20 text-landing-muted">+ <Loader2 size={20} className="animate-spin" />+ <span className="text-sm">{t.loading}</span>+ </div>+ )}++ {error && !loading && (+ <div className="flex flex-col items-center gap-4 py-20">+ <AlertTriangle size={28} className="text-yellow-500" />+ <span className="text-landing-muted text-sm">{t.error}</span>+ <button+ type="button"+ onClick={loadRegistry}+ className="landing-nav-link rounded-[7px] px-4 py-2 text-sm font-medium border border-landing-line"+ >+ {t.retry}+ </button>+ </div>+ )}++ {registry && !loading && (+ <>+ <div className="landing-glass-card mb-12 overflow-hidden rounded-[10px]">+ <div className="flex flex-wrap items-center justify-between gap-3 border-b border-landing-line bg-landing-panel/70 p-3">+ <div className="inline-flex shrink-0 rounded-[8px] border border-landing-line bg-black/10 p-1">+ <button+ type="button"+ onClick={() => setActiveTab("drivers")}+ className={`inline-flex h-8 cursor-pointer items-center gap-2 rounded-[6px] px-3 text-xs font-[650] transition-colors ${+ activeTab === "drivers"+ ? "bg-landing-blue text-white"+ : "text-landing-muted hover:text-landing-ink"+ }`}+ >+ <Database size={14} />+ {t.drivers}+ </button>+ <button+ type="button"+ onClick={() => setActiveTab("jre")}+ className={`inline-flex h-8 cursor-pointer items-center gap-2 rounded-[6px] px-3 text-xs font-[650] transition-colors ${+ activeTab === "jre" ? "bg-landing-blue text-white" : "text-landing-muted hover:text-landing-ink"+ }`}+ >+ <Cpu size={14} />+ {t.jre}+ </button>+ </div>++ <div className="flex min-w-[280px] flex-1 items-center gap-3 max-[760px]:min-w-full">+ <div className="relative min-w-0 flex-1">+ <Search+ size={15}+ className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-landing-muted"+ />+ <input+ value={searchQuery}+ onChange={(event) => setSearchQuery(event.target.value)}+ placeholder={t.search}+ className="h-9 w-full rounded-[8px] border border-landing-line bg-black/10 pl-9 pr-9 text-sm text-landing-ink outline-none transition-colors placeholder:text-landing-muted focus:border-landing-blue"+ />+ {searchQuery && (+ <button+ type="button"+ onClick={() => setSearchQuery("")}+ className="absolute right-2 top-1/2 grid h-6 w-6 -translate-y-1/2 cursor-pointer place-items-center rounded-[6px] text-landing-muted hover:bg-landing-soft hover:text-landing-ink"+ aria-label={t.clearSearch}+ >+ <X size={14} />+ </button>+ )}+ </div>+ <span className="shrink-0 text-xs text-landing-muted">+ {t.showing} {activeCount} {t.of} {activeTotal}+ </span>+ </div>+ </div>++ {activeTab === "drivers" && (+ <>+ <p className="border-b border-landing-line px-5 py-3 text-sm text-landing-muted whitespace-nowrap max-[760px]:whitespace-normal max-[760px]:px-4">+ {t.driversDesc}+ </p>+ <table className="w-full table-auto border-collapse text-sm max-[760px]:block">+ <thead className="bg-landing-panel text-xs font-medium text-landing-muted max-[760px]:hidden">+ <tr className="border-b border-landing-line">+ <th className="px-5 py-2.5 text-left font-medium">Driver</th>+ <th className="px-5 py-2.5 text-left font-medium">Key</th>+ <th className="px-5 py-2.5 text-left font-medium">{t.version}</th>+ <th className="px-5 py-2.5 text-left font-medium">{t.requiresJre}</th>+ <th className="px-5 py-2.5 text-right font-medium">{t.size}</th>+ <th className="w-24 px-5 py-2.5" />+ </tr>+ </thead>+ <tbody className="max-[760px]:block">+ {filteredDrivers.map((d) => (+ <tr+ key={d.key}+ className="border-b border-landing-line transition-colors last:border-b-0 hover:bg-landing-panel max-[760px]:grid max-[760px]:grid-cols-[1fr_auto] max-[760px]:items-center max-[760px]:gap-3 max-[760px]:px-4"+ >+ <td className="min-w-0 px-5 py-3 font-medium text-landing-ink max-[760px]:px-0">+ <div className="flex min-w-0 items-center gap-2">+ <span className="min-w-0 truncate">{d.label}</span>+ <span className="hidden shrink-0 rounded-[5px] border border-landing-blue/35 bg-landing-blue/10 px-1.5 py-0.5 font-mono text-[11px] text-landing-sky max-[760px]:inline">+ {d.key}+ </span>+ </div>+ </td>+ <td className="px-5 py-3 max-[760px]:hidden">+ <span className="inline-flex rounded-[5px] border border-landing-blue/35 bg-landing-blue/10 px-1.5 py-0.5 font-mono text-[11px] text-landing-sky">+ {d.key}+ </span>+ </td>+ <td className="px-5 py-3 text-xs text-landing-muted max-[760px]:hidden">{d.version}</td>+ <td className="px-5 py-3 text-xs text-landing-muted max-[760px]:hidden">{d.jre}</td>+ <td className="px-5 py-3 text-right text-xs text-landing-muted max-[760px]:hidden">+ {formatSize(d.jar.size)}+ </td>+ <td className="px-5 py-3 text-right max-[760px]:px-0">+ <a+ href={d.jar.url}+ download+ className="landing-nav-link inline-flex h-8 items-center gap-1 whitespace-nowrap rounded-[6px] border border-landing-line px-2.5 text-xs font-medium transition-colors hover:border-landing-blue"+ >+ <Download size={13} />+ {t.download}+ </a>+ </td>+ </tr>+ ))}+ </tbody>+ </table>+ {filteredDrivers.length === 0 && (+ <div className="px-5 py-12 text-center text-sm text-landing-muted">{t.noResults}</div>+ )}+ </>+ )}++ {activeTab === "jre" && (+ <>+ <p className="border-b border-landing-line px-5 py-3 text-sm text-landing-muted whitespace-nowrap max-[760px]:whitespace-normal max-[760px]:px-4">+ {t.jreDesc}+ </p>+ <table className="w-full table-auto border-collapse text-sm max-[760px]:block">+ <thead className="bg-landing-panel text-xs font-medium text-landing-muted max-[760px]:hidden">+ <tr className="border-b border-landing-line">+ <th className="px-5 py-2.5 text-left font-medium">{t.platform}</th>+ <th className="px-5 py-2.5 text-left font-medium">JRE</th>+ <th className="px-5 py-2.5 text-left font-medium">{t.version}</th>+ <th className="px-5 py-2.5 text-right font-medium">{t.size}</th>+ <th className="w-24 px-5 py-2.5" />+ </tr>+ </thead>+ <tbody className="max-[760px]:block">+ {filteredJres.map((j) => {+ const key = platformKey(j);+ return (+ <tr+ key={key}+ className="border-b border-landing-line transition-colors last:border-b-0 hover:bg-landing-panel max-[760px]:grid max-[760px]:grid-cols-[1fr_auto] max-[760px]:items-center max-[760px]:gap-3 max-[760px]:px-4"+ >+ <td className="min-w-0 px-5 py-3 font-medium text-landing-ink max-[760px]:px-0">+ <div className="flex min-w-0 items-center gap-2">+ <span className="min-w-0 truncate">{j.platformLabel}</span>+ <span className="hidden shrink-0 rounded-[5px] border border-landing-green/35 bg-landing-green/10 px-1.5 py-0.5 font-mono text-[11px] text-landing-green max-[760px]:inline">+ JRE {j.jreKey}+ </span>+ </div>+ </td>+ <td className="px-5 py-3 max-[760px]:hidden">+ <span className="inline-flex rounded-[5px] border border-landing-green/35 bg-landing-green/10 px-1.5 py-0.5 font-mono text-[11px] text-landing-green">+ JRE {j.jreKey}+ </span>+ </td>+ <td className="px-5 py-3 text-xs text-landing-muted max-[760px]:hidden">{j.jreVersion}</td>+ <td className="px-5 py-3 text-right text-xs text-landing-muted max-[760px]:hidden">+ {formatSize(j.info.size)}+ </td>+ <td className="px-5 py-3 text-right max-[760px]:px-0">+ <a+ href={j.info.url}+ download+ className="landing-nav-link inline-flex h-8 items-center gap-1 whitespace-nowrap rounded-[6px] border border-landing-line px-2.5 text-xs font-medium transition-colors hover:border-landing-blue"+ >+ <Download size={13} />+ {t.download}+ </a>+ </td>+ </tr>+ );+ })}+ </tbody>+ </table>+ {filteredJres.length === 0 && (+ <div className="px-5 py-12 text-center text-sm text-landing-muted">{t.noResults}</div>+ )}+ </>+ )}+ </div>++ <div className="landing-glass-card rounded-[10px] p-5 text-sm text-landing-muted leading-[1.65]">+ <strong className="text-landing-ink">{lang === "cn" ? "离线使用说明" : "Offline Usage"}</strong>+ <p className="mt-1">{t.downloadHint}</p>+ </div>+ </>+ )}+ </section>+ </main>+ );+}diff --git a/docs/app/[lang]/drivers/page.tsx b/docs/app/[lang]/drivers/page.tsxnew file mode 100644index 0000000000..bcfa21b407--- /dev/null+++ b/docs/app/[lang]/drivers/page.tsx@@ -0,0 +1,38 @@+import { DriversClient } from "./DriversClient";+import { buildMetadata } from "@/lib/metadata";+import type { Metadata } from "next";++const pageMeta = {+ en: {+ title: "Offline Driver Downloads",+ description:+ "Download all database drivers and JRE packages for offline use. Supports 30+ database types across macOS, Linux, and Windows.",+ },+ cn: {+ title: "离线驱动下载",+ description:+ "下载所有数据库驱动和 JRE 离线包,支持 30+ 种数据库类型,覆盖 macOS、Linux、Windows 平台。",+ },+};++export async function generateMetadata({+ params,+}: {+ params: Promise<{ lang: string }>;+}): Promise<Metadata> {+ const { lang } = await params;+ const l = lang === "cn" ? "cn" : "en";+ const meta = pageMeta[l];++ return buildMetadata({+ title: meta.title,+ description: meta.description,+ path: `/${l}/drivers`,+ lang: l,+ ogType: "website",+ });+}++export default function DriversPage() {+ return <DriversClient />;+}diff --git a/docs/components/landing/LandingNav.tsx b/docs/components/landing/LandingNav.tsxindex 5f0432ad47..9d1ee83d8a 100644--- a/docs/components/landing/LandingNav.tsx+++ b/docs/components/landing/LandingNav.tsx@@ -4,8 +4,15 @@ import Link from 'next/link';import { useEffect, useRef } from 'react';const i18n = {- en: { home: 'Home', docs: 'Docs', changelog: 'Changelog', community: 'Community', lang: '中文' },- cn: { home: '首页', docs: '文档', changelog: '更新日志', community: '交流群', lang: 'English' },+ en: {+ home: 'Home',+ docs: 'Docs',+ changelog: 'Changelog',+ community: 'Community',+ drivers: 'Offline Drivers',+ lang: '中文',+ },+ cn: { home: '首页', docs: '文档', changelog: '更新日志', community: '交流群', drivers: '离线驱动', lang: 'English' },};export function LandingNav({@@ -13,7 +20,7 @@ export function LandingNav({active,}: {lang: 'en' | 'cn';- active?: 'home' | 'changelog' | 'community';+ active?: 'home' | 'changelog' | 'community' | 'drivers';}) {const ref = useRef<HTMLElement>(null);const t = i18n[lang];@@ -21,6 +28,7 @@ export function LandingNav({const langHrefMap: Record<string, string> = {changelog: `/${otherLang}/changelog`,community: `/${otherLang}/community`,+ drivers: `/${otherLang}/drivers`,};const langHref = langHrefMap[active ?? ''] ?? `/${otherLang}`;@@ -69,6 +77,12 @@ export function LandingNav({>{t.community}</Link>+ <Link+ href={`/${lang}/drivers`}+ className={`landing-nav-link rounded-[7px] px-[11px] py-2 text-[13px] font-medium max-[760px]:hidden ${active === 'drivers' ? 'text-landing-ink' : 'text-landing-muted'}`}+ >+ {t.drivers}+ </Link><Linkhref="https://github.com/t8y2/dbx"target="_blank"diff --git a/docs/lib/agentRegistry.ts b/docs/lib/agentRegistry.tsnew file mode 100644index 0000000000..2b9126033a--- /dev/null+++ b/docs/lib/agentRegistry.ts@@ -0,0 +1,141 @@+const R2_CDN_BASE = "https://dl.dbxio.com";++function filenameFromUrl(url: string): string {+ return url.split("/").pop() ?? url;+}++function githubUrlToR2Url(url: string, category: "jre" | "driver"): string {+ const filename = filenameFromUrl(url);+ return `${R2_CDN_BASE}/agents/${category}/${filename}`;+}++export interface ArtifactInfo {+ url: string;+ size: number;+}++export interface JreInfo {+ version: string;+ platforms: Record<string, ArtifactInfo>;+}++export interface DriverInfo {+ version: string;+ label: string;+ min_app_version: string;+ jar: ArtifactInfo;+ jre: string;+}++export interface AgentRegistry {+ jre?: JreInfo;+ jres?: Record<string, JreInfo>;+ drivers: Record<string, DriverInfo>;+}++const AGENT_REGISTRY_R2_URL = "https://dl.dbxio.com/agents/agent-registry.json";+const AGENT_REGISTRY_GITHUB_URL =+ "https://github.com/t8y2/dbx-agents/releases/latest/download/agent-registry.json";++export async function fetchAgentRegistry(): Promise<AgentRegistry | null> {+ const urls = [AGENT_REGISTRY_R2_URL, AGENT_REGISTRY_GITHUB_URL];+ for (const url of urls) {+ try {+ const res = await fetch(url, {+ cache: "no-store",+ headers: { Accept: "application/json" },+ });+ if (res.ok) {+ return (await res.json()) as AgentRegistry;+ }+ } catch {+ continue;+ }+ }+ return null;+}++export interface JreDisplayEntry {+ platformKey: string;+ platformLabel: string;+ info: ArtifactInfo;+ jreVersion: string;+ jreKey: string;+ r2Url: string;+}++export interface DriverDisplayEntry {+ key: string;+ label: string;+ version: string;+ minAppVersion: string;+ jar: ArtifactInfo;+ jre: string;+ r2Url: string;+}++export function buildJreEntries(registry: AgentRegistry): JreDisplayEntry[] {+ const entries: JreDisplayEntry[] = [];+ const platformLabels: Record<string, string> = {+ "macos-aarch64": "macOS (Apple Silicon)",+ "macos-x64": "macOS (Intel)",+ "linux-aarch64": "Linux (ARM64)",+ "linux-x64": "Linux (x64)",+ "windows-aarch64": "Windows (ARM64)",+ "windows-x64": "Windows (x64)",+ };++ const jres = registry.jres ?? {};+ for (const [key, jreInfo] of Object.entries(jres)) {+ for (const [platformKey, artifact] of Object.entries(jreInfo.platforms)) {+ entries.push({+ platformKey,+ platformLabel: platformLabels[platformKey] ?? platformKey,+ info: artifact,+ jreVersion: jreInfo.version,+ jreKey: key,+ r2Url: githubUrlToR2Url(artifact.url, "jre"),+ });+ }+ }++ if (entries.length === 0 && registry.jre) {+ for (const [platformKey, artifact] of Object.entries(registry.jre.platforms)) {+ entries.push({+ platformKey,+ platformLabel: platformLabels[platformKey] ?? platformKey,+ info: artifact,+ jreVersion: registry.jre.version,+ jreKey: "21",+ r2Url: githubUrlToR2Url(artifact.url, "jre"),+ });+ }+ }++ return entries;+}++export function buildDriverEntries(registry: AgentRegistry): DriverDisplayEntry[] {+ return Object.entries(registry.drivers).map(([key, info]) => ({+ key,+ label: info.label,+ version: info.version,+ minAppVersion: info.min_app_version,+ jar: info.jar,+ jre: info.jre,+ r2Url: githubUrlToR2Url(info.jar.url, "driver"),+ }));+}++export function formatSize(bytes: number): string {+ if (bytes >= 1024 * 1024 * 1024) {+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;+ }+ if (bytes >= 1024 * 1024) {+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;+ }+ if (bytes >= 1024) {+ return `${(bytes / 1024).toFixed(1)} KB`;+ }+ return `${bytes} B`;+}