consolidate remote & local source into one

This commit is contained in:
2026-08-14 18:58:19 +08:00
parent 747e0840f4
commit 828ce5465d
10 changed files with 157 additions and 558 deletions
+30
View File
@@ -0,0 +1,30 @@
use tauri::{AppHandle, Manager, WebviewUrl};
const WINDOW_LABEL: &str = "debug";
pub fn init(handle: &AppHandle) {
if let Some(window) = handle.get_webview_window(WINDOW_LABEL) {
if !window.is_visible().unwrap() {
window.center().unwrap();
window.show().unwrap();
};
window.set_focus().unwrap();
return;
};
let builder =
tauri::WebviewWindowBuilder::new(handle, WINDOW_LABEL, WebviewUrl::App("/".into()))
.title("Wyd Debug")
.inner_size(800.0, 600.0)
.min_inner_size(500.0, 400.0)
.visible(true);
let window = builder.build().unwrap();
let window_c = window.clone();
window.on_window_event(move |event: &tauri::WindowEvent| {
if let tauri::WindowEvent::CloseRequested { api, .. } = event {
api.prevent_close();
window_c.hide().unwrap();
}
});
}