From e0dd61ddcaace2411689c63f40129b6d7e752937 Mon Sep 17 00:00:00 2001 From: CakeAL <1742507190@qq.com> Date: Tue, 5 Nov 2024 19:35:57 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(OtherTools):=20add=20web=20vpn?= =?UTF-8?q?=20convert=20website=20and=20open=20other=20sites?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src-tauri/Cargo.lock | 87 ++++++++++++++++++++++++++++ src-tauri/Cargo.toml | 1 + src-tauri/capabilities/default.json | 3 +- src-tauri/src/lib.rs | 4 +- src-tauri/tauri.conf.json | 3 + src/pages/About.vue | 90 +++++++++++++++++++++++------ src/pages/Login.vue | 28 ++++++--- src/pages/OtherTools.vue | 74 ++++++++++++++---------- src/pages/UnbindMacs.vue | 16 +++-- 9 files changed, 241 insertions(+), 65 deletions(-) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index eccca72..60a9ce5 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -936,6 +936,15 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "endi" version = "1.1.0" @@ -1774,6 +1783,25 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is-docker" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bae27f42bc99b60d9ac7334e3a21d10ad8f1835a4e12ec3ec0464765ed1b3" +dependencies = [ + "once_cell", +] + +[[package]] +name = "is-wsl" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "173609498df190136aa7dea1a91db051746d339e18476eed5ca40521f02d7aa5" +dependencies = [ + "is-docker", + "once_cell", +] + [[package]] name = "itoa" version = "0.4.8" @@ -2492,6 +2520,17 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "open" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a877bf6abd716642a53ef1b89fb498923a4afca5c754f9050b4d081c05c4b3" +dependencies = [ + "is-wsl", + "libc", + "pathdiff", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -2508,6 +2547,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "os_pipe" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "pango" version = "0.18.3" @@ -2562,6 +2611,12 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "pathdiff" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61c5ce1153ab5b689d0c074c4e7fc613e942dfb7dd9eea5ab202d2ad91fe361" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -3554,6 +3609,16 @@ dependencies = [ "digest", ] +[[package]] +name = "shared_child" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fa9338aed9a1df411814a5b2252f7cd206c55ae9bf2fa763f8de84603aa60c" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -3996,6 +4061,27 @@ dependencies = [ "uuid", ] +[[package]] +name = "tauri-plugin-shell" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad7880c5586b6b2104be451e3d7fc0f3800c84bda69e9ba81c828f87cb34267" +dependencies = [ + "encoding_rs", + "log", + "open", + "os_pipe", + "regex", + "schemars", + "serde", + "serde_json", + "shared_child", + "tauri", + "tauri-plugin", + "thiserror", + "tokio", +] + [[package]] name = "tauri-plugin-updater" version = "2.0.2" @@ -4556,6 +4642,7 @@ dependencies = [ "tauri", "tauri-build", "tauri-plugin-dialog", + "tauri-plugin-shell", "tauri-plugin-updater", "tokio", "window-vibrancy", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index ee5ed7f..1ace0b0 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -28,6 +28,7 @@ mac_address = "1.1.7" # tauri plugin window-vibrancy = "0.5.2" tauri-plugin-dialog = "2" +tauri-plugin-shell = "2" # others anyhow = "1" rand = "0.8.5" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index f28ef33..8d93615 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -22,6 +22,7 @@ "core:window:allow-close", "core:window:allow-start-dragging", "updater:default", - "dialog:default" + "dialog:default", + "shell:default" ] } \ No newline at end of file diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 98b3766..5c885b0 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -16,7 +16,9 @@ use tauri_plugin_updater::UpdaterExt; #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { - let mut builder = tauri::Builder::new().plugin(tauri_plugin_dialog::init()); + let mut builder = tauri::Builder::new() + .plugin(tauri_plugin_dialog::init()) + .plugin(tauri_plugin_shell::init()); #[cfg(not(any(target_os = "android", target_os = "linux")))] { builder = builder.plugin(tauri_plugin_updater::Builder::new().build()); diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 1b64a87..09a492f 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -52,6 +52,9 @@ "endpoints": [ "https://github.com/CakeAL/ustb-wifi-tools/releases/latest/download/latest.json" ] + }, + "shell": { + "open": false } } } diff --git a/src/pages/About.vue b/src/pages/About.vue index 93eef01..29b1254 100644 --- a/src/pages/About.vue +++ b/src/pages/About.vue @@ -1,4 +1,5 @@