From abd3450814aa71d986253947c1e3542f82c574be Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Thu, 14 May 2026 11:03:12 +0800 Subject: [PATCH] feat(connection): make driver manager link clickable in install hint --- src-tauri/src/lib.rs | 14 ++++++++++++++ src/App.vue | 4 ++++ src/components/connection/ConnectionDialog.vue | 7 ++++++- src/components/layout/AppDialogs.vue | 2 ++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 9a0db7656..1b2f8ea82 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -47,6 +47,20 @@ pub fn run() { } } + if let Some(window) = app.get_webview_window("main") { + if let Ok(Some(monitor)) = window.current_monitor() { + let monitor_size = monitor.size(); + if let Ok(window_size) = window.outer_size() { + if window_size.width > monitor_size.width || window_size.height > monitor_size.height { + let scale = monitor.scale_factor(); + let _ = window + .set_size(tauri::PhysicalSize::new((1280.0 * scale) as u32, (800.0 * scale) as u32)); + let _ = window.center(); + } + } + } + } + Ok(()) }) .on_window_event(|window, event| { diff --git a/src/App.vue b/src/App.vue index eb402a2af..238bbc8d8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -751,6 +751,10 @@ onUnmounted(() => { @connect-failed=" (msg: string) => toast(t('connection.connectFailed', { message: translateBackendError(t, msg) }), 5000) " + @open-driver-store=" + showConnectionDialog = false; + showDriverStore = true; + " @structure-editor-saved="onStructureEditorSaved(onReloadData, toast)" @open-lineage-target="openLineageTarget" @open-database-search-target="openDatabaseSearchTarget" diff --git a/src/components/connection/ConnectionDialog.vue b/src/components/connection/ConnectionDialog.vue index 511b3cd6a..52111148b 100644 --- a/src/components/connection/ConnectionDialog.vue +++ b/src/components/connection/ConnectionDialog.vue @@ -40,6 +40,7 @@ const emit = defineEmits<{ connectStarted: [name: string]; connectSucceeded: [name: string]; connectFailed: [message: string]; + openDriverStore: []; }>(); const store = useConnectionStore(); @@ -1155,7 +1156,11 @@ function openExternalUrl(url: string) {

- 需要在顶部导航栏「驱动管理」中安装对应的驱动才能连接。 + 需要在顶部导航栏「驱动管理」中安装对应的驱动才能连接。

diff --git a/src/components/layout/AppDialogs.vue b/src/components/layout/AppDialogs.vue index 7d0e92b85..f90137a19 100644 --- a/src/components/layout/AppDialogs.vue +++ b/src/components/layout/AppDialogs.vue @@ -39,6 +39,7 @@ const emit = defineEmits<{ connectStarted: [name: string]; connectSucceeded: [name: string]; connectFailed: [message: string]; + openDriverStore: []; structureEditorSaved: []; openLineageTarget: [ target: { @@ -100,6 +101,7 @@ watch( @connect-started="emit('connectStarted', $event)" @connect-succeeded="emit('connectSucceeded', $event)" @connect-failed="emit('connectFailed', $event)" + @open-driver-store="emit('openDriverStore')" />