From 1efe5f01b10b7a54f0b3e128ee6813fa1de6b333 Mon Sep 17 00:00:00 2001 From: AkiChase <1003019131@qq.com> Date: Sun, 5 May 2024 13:13:26 +0800 Subject: [PATCH] feat(About): add update check --- README.md | 8 +++- package.json | 1 + src-tauri/Cargo.toml | 1 + src-tauri/capabilities/default.json | 12 ++++- src-tauri/src/main.rs | 1 + src/components/setting/About.vue | 68 ++++++++++++++++++++++++++++- 6 files changed, 87 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 767a872..a305f57 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Scrcpy-mask -A Scrcpy (control) client in Rust & Tarui aimed at providing mouse and key mapping. +A Scrcpy client in Rust & Tarui aimed at providing mouse and key mapping to control Android device. Due to the delay and blurred image quality of the mirror screen. This project found another way, directly abandoned the mirror screen, and instead used a transparent mask to display the screen content behind the window, which fundamentally put an end to the delay in casting the screen. @@ -9,8 +9,12 @@ Due to the delay and blurred image quality of the mirror screen. This project fo - [x] Wired and wireless connections to Android devices - [x] Start scrcpy-server and connect to it - [x] Implement scrcpy client control protocol -- [x] Mouse and keyboard mapping +- [x] Mouse and keyboard key mapping - [x] Visually setting the mapping +- [x] Key mapping config import and export +- [x] Update check +- [ ] Switch between key mapping and raw input +- [ ] Better macro support - [ ] Provide external interface through websocket ## contribution. diff --git a/package.json b/package.json index b6c6c87..f18c49b 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "dependencies": { "@tauri-apps/api": ">=2.0.0-beta.8", "@tauri-apps/plugin-clipboard-manager": "2.1.0-beta.0", + "@tauri-apps/plugin-http": "2.0.0-beta.3", "@tauri-apps/plugin-process": "2.0.0-beta.2", "@tauri-apps/plugin-shell": "2.0.0-beta.3", "@tauri-apps/plugin-store": "2.0.0-beta.2", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 4bb8003..a05cdf8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -20,3 +20,4 @@ tokio = { version = "1.36.0", features = ["rt-multi-thread", "net", "macros", "i tauri-plugin-clipboard-manager = "2.1.0-beta.1" tauri-plugin-process = "2.0.0-beta.3" tauri-plugin-shell = "2.0.0-beta.4" +tauri-plugin-http = "2.0.0-beta.7" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 470833c..6c2fe4f 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -29,6 +29,16 @@ "webview:default", "webview:allow-internal-toggle-devtools", "shell:default", - "shell:allow-open" + "shell:allow-open", + "http:default", + { + "identifier": "http:default", + "allow": [ + { "url": "https://api.github.com/repos/AkiChase/scrcpy-mask/*" } + ] + }, + "http:allow-fetch", + "app:default", + "app:allow-version" ] } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 42e6c57..52b7eb2 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -142,6 +142,7 @@ fn load_default_keyconfig(app: tauri::AppHandle) -> Result { #[tokio::main] async fn main() { tauri::Builder::default() + .plugin(tauri_plugin_http::init()) .plugin(tauri_plugin_shell::init()) .plugin(tauri_plugin_process::init()) .plugin(tauri_plugin_clipboard_manager::init()) diff --git a/src/components/setting/About.vue b/src/components/setting/About.vue index 0003141..fc2716c 100644 --- a/src/components/setting/About.vue +++ b/src/components/setting/About.vue @@ -1,11 +1,74 @@