From 8ecfae29a480574db068bbc025f5ee08b8713b84 Mon Sep 17 00:00:00 2001 From: axiangcoding Date: Thu, 13 Jun 2024 10:13:32 +0800 Subject: [PATCH 01/12] update --- src-tauri/Cargo.lock | 7 +++ src-tauri/Cargo.toml | 4 +- src-tauri/src/commands/manage_wt.rs | 69 +++++------------------------ src-tauri/src/commands/mod.rs | 2 - src-tauri/src/commands/os.rs | 25 ++--------- src-tauri/src/main.rs | 9 +++- src-tauri/src/tools/fs.rs | 40 +++++++++++++++++ src/pages/About.vue | 6 +++ 8 files changed, 79 insertions(+), 83 deletions(-) delete mode 100644 src-tauri/src/commands/mod.rs create mode 100644 src-tauri/src/tools/fs.rs diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 9ec7582..9b2d982 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -863,6 +863,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futf" version = "0.1.5" @@ -4052,6 +4058,7 @@ dependencies = [ name = "wt-helper-app" version = "0.0.0" dependencies = [ + "fs_extra", "serde", "serde_json", "sevenz-rust", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index f6b0c4a..26d24c5 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -11,7 +11,8 @@ edition = "2021" tauri-build = { version = "1", features = [] } [dependencies] -tauri = { version = "1", features = [ "window-start-dragging", +tauri = { version = "1", features = [ + "window-start-dragging", "fs-all", "path-all", "dialog-open", @@ -24,6 +25,7 @@ zip = "2.1.3" tempfile = "3" walkdir = "2.5.0" winreg = "0.52.0" +fs_extra = "1.3.0" [features] # This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!! diff --git a/src-tauri/src/commands/manage_wt.rs b/src-tauri/src/commands/manage_wt.rs index 132c893..76df863 100644 --- a/src-tauri/src/commands/manage_wt.rs +++ b/src-tauri/src/commands/manage_wt.rs @@ -1,9 +1,10 @@ use std::{ - fs, io, + fs, path::{Path, PathBuf}, }; use walkdir::WalkDir; -use zip::ZipArchive; + +use crate::tools; #[tauri::command] pub fn auto_detected_wt_install_path() -> Result { @@ -80,7 +81,7 @@ pub fn install_user_skin(skin_path: String, wt_install_path: String) -> Result<( new_path.display() )); } - match copy_everything_to(&skin_pb, &new_path) { + match tools::fs::copy_folder(&skin_pb, &new_path) { Ok(_) => Ok(()), Err(err) => Err(format!("Failed to copy skin folder: {}", err)), } @@ -90,7 +91,7 @@ pub fn install_user_skin(skin_path: String, wt_install_path: String) -> Result<( tempfile::tempdir().map_err(|e| format!("Failed to create temp dir: {}", e))?; let temp_path = temp_dir.path(); - decompress_file(skin_pb, temp_path).unwrap(); + tools::fs::decompress_file(skin_pb.as_path(), temp_path).unwrap(); // 查找解压后的文件夹 let mut extracted_folder = None; @@ -120,7 +121,7 @@ pub fn install_user_skin(skin_path: String, wt_install_path: String) -> Result<( new_path.display() )); } - match copy_everything_to(&extracted_folder, &new_path) { + match tools::fs::copy_folder(&extracted_folder, &new_path) { Ok(_) => Ok(()), Err(err) => Err(format!("Failed to copy extracted skin folder: {}", err)), } @@ -155,7 +156,7 @@ pub fn install_user_sight(sight_path: String, wt_install_path: String) -> Result new_path.display() )); } - match copy_everything_to(&sight_pb, &new_path) { + match tools::fs::copy_folder(&sight_pb, &new_path) { Ok(_) => Ok(()), Err(err) => Err(format!("Failed to copy sight folder: {}", err)), } @@ -164,7 +165,7 @@ pub fn install_user_sight(sight_path: String, wt_install_path: String) -> Result tempfile::tempdir().map_err(|e| format!("Failed to create temp dir: {}", e))?; let temp_path = temp_dir.path(); - decompress_file(sight_pb, temp_path).unwrap(); + tools::fs::decompress_file(sight_pb.as_path(), temp_path).unwrap(); // 查找解压后的文件夹 let mut extracted_folder = None; @@ -194,7 +195,7 @@ pub fn install_user_sight(sight_path: String, wt_install_path: String) -> Result new_path.display() )); } - match copy_everything_to(&extracted_folder, &new_path) { + match tools::fs::copy_folder(&extracted_folder, &new_path) { Ok(_) => Ok(()), Err(err) => Err(format!("Failed to copy extracted sight folder: {}", err)), } @@ -204,28 +205,6 @@ pub fn install_user_sight(sight_path: String, wt_install_path: String) -> Result } } -fn decompress_file(pb: PathBuf, temp_path: &Path) -> Result<(), String> { - let extension: &str = pb.extension().and_then(|e| e.to_str()).unwrap_or(""); - match extension.to_lowercase().as_str() { - "zip" => { - let file = - fs::File::open(&pb).map_err(|e| format!("Failed to open zip file: {}", e))?; - let mut archive = - ZipArchive::new(file).map_err(|e| format!("Failed to read zip file: {}", e))?; - archive - .extract(&temp_path) - .map_err(|e| format!("Failed to extract zip file: {}", e))?; - } - "rar" => return Err(format!("not support rar file now")), - "7z" => { - sevenz_rust::decompress_file(&pb, &temp_path) - .map_err(|e| format!("Failed to extract 7z file: {}", e))?; - } - _ => return Err(format!("Unsupported file extension: {}", extension)), - } - Ok(()) -} - #[tauri::command] pub fn check_is_valid_wt_install_path(path: String) -> bool { let path = Path::new(&path); @@ -252,21 +231,6 @@ fn check_is_folder_contains_wt_launcher(path: &Path) -> bool { return false; } -fn copy_everything_to(old_path: &Path, new_path: &Path) -> io::Result<()> { - if old_path.is_dir() { - fs::create_dir(new_path)?; - for entry in fs::read_dir(old_path)? { - let entry = entry?; - let path = entry.path(); - let new_path = new_path.join(path.file_name().unwrap()); - copy_everything_to(&path, &new_path)?; - } - } else { - fs::copy(old_path, new_path)?; - } - Ok(()) -} - fn check_is_folder_contains_blk_file(path: &PathBuf) -> bool { if !path.exists() { return false; @@ -297,17 +261,6 @@ pub struct UserSkinInfo { folder_size: u64, } -fn calculate_directory_size(path: &Path) -> io::Result { - let mut total_size = 0; - for entry in WalkDir::new(path) { - let entry = entry?; - if entry.file_type().is_file() { - total_size += entry.metadata()?.len(); - } - } - Ok(total_size) -} - #[tauri::command] pub fn get_user_skins(wt_install_path: String) -> Result, String> { let skin_base_path = Path::new(&wt_install_path).join("UserSkins"); @@ -349,7 +302,7 @@ pub fn get_user_skins(wt_install_path: String) -> Result, Stri .to_string_lossy() .to_string(); let full_path = entry.path().to_string_lossy().to_string(); - let folder_size = calculate_directory_size(entry.path()).unwrap(); + let folder_size = fs_extra::dir::get_size(entry.path()).unwrap(); infos.push(UserSkinInfo { vehicle_id, skin_name, @@ -417,7 +370,7 @@ pub fn get_user_sights(wt_install_path: String) -> Result, St .to_string_lossy() .to_string(); let full_path = entry.path().to_string_lossy().to_string(); - let folder_size = calculate_directory_size(entry.path()).unwrap(); + let folder_size = fs_extra::dir::get_size(entry.path()).unwrap(); infos.push(UserSightInfo { vehicle_id, folder_name, diff --git a/src-tauri/src/commands/mod.rs b/src-tauri/src/commands/mod.rs deleted file mode 100644 index c6ad6c4..0000000 --- a/src-tauri/src/commands/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod manage_wt; -pub mod os; diff --git a/src-tauri/src/commands/os.rs b/src-tauri/src/commands/os.rs index b8b876c..1748d2d 100644 --- a/src-tauri/src/commands/os.rs +++ b/src-tauri/src/commands/os.rs @@ -54,32 +54,15 @@ pub fn show_in_folder(path: String) { #[tauri::command] pub fn delete_folder(path: String) -> Result<(), String> { - let path = Path::new(&path); - - // 检查路径是否存在 - if !path.exists() { - return Err(format!("Path does not exist: {}", path.display())); - } - - // 检查是否是目录 - if !path.is_dir() { - return Err(format!("Path is not a directory: {}", path.display())); - } - - // 尝试删除目录及其内容 - match fs::remove_dir_all(path) { - Ok(_) => Ok(()), - Err(err) => Err(format!("Failed to delete folder: {}", err)), - } + fs_extra::dir::remove(path).map_err(|e| e.to_string()) } #[tauri::command] -pub fn create_folder(path: String) { +pub fn create_folder(path: String) -> Result<(), String> { let path = Path::new(&path); - // 检查路径是否存在 if !path.exists() { - // 尝试创建目录 - fs::create_dir_all(path).unwrap(); + fs::create_dir_all(path).map_err(|e| e.to_string())?; } + Ok(()) } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 6632734..7d67b35 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -1,7 +1,14 @@ // Prevents additional console window on Windows in release, DO NOT REMOVE!! #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] -mod commands; +mod commands { + pub mod manage_wt; + pub mod os; +} + +mod tools { + pub mod fs; +} // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command diff --git a/src-tauri/src/tools/fs.rs b/src-tauri/src/tools/fs.rs new file mode 100644 index 0000000..b5698dd --- /dev/null +++ b/src-tauri/src/tools/fs.rs @@ -0,0 +1,40 @@ +use std::{fs, path::Path}; + +use fs_extra::dir::{copy, CopyOptions}; +use zip::ZipArchive; + +/// Copy a folder from the source path to the target path. +/// +/// 将源路径的文件夹复制到目标路径。 +pub fn copy_folder(from: &Path, to: &Path) -> Result<(), Box> { + let options = CopyOptions::new().overwrite(true).copy_inside(true); //Initialize default values for CopyOptions + + // copy source/dir1 to target/dir1 + copy(from, to, &options)?; + Ok(()) +} + +/// Decompress a file with extension zip, rar or 7z to the target path. +/// +/// 解压缩扩展名为 zip、rar 或 7z 的文件到目标路径。 +pub fn decompress_file(file_path: &Path, target_path: &Path) -> Result<(), String> { + let extension: &str = file_path.extension().and_then(|e| e.to_str()).unwrap_or(""); + match extension.to_lowercase().as_str() { + "zip" => { + let file = fs::File::open(&file_path) + .map_err(|e| format!("Failed to open zip file: {}", e))?; + let mut archive = + ZipArchive::new(file).map_err(|e| format!("Failed to read zip file: {}", e))?; + archive + .extract(&target_path) + .map_err(|e| format!("Failed to extract zip file: {}", e))?; + } + "rar" => return Err(format!("not support rar file now")), + "7z" => { + sevenz_rust::decompress_file(&file_path, &target_path) + .map_err(|e| format!("Failed to extract 7z file: {}", e))?; + } + _ => return Err(format!("Unsupported file extension: {}", extension)), + } + Ok(()) +} diff --git a/src/pages/About.vue b/src/pages/About.vue index 97c8412..ae449dc 100644 --- a/src/pages/About.vue +++ b/src/pages/About.vue @@ -47,6 +47,12 @@ const items = [ subtitle: "这个版本继续强化各项功能的可用性,并引入了一些新的能力", description: ["自定义涂装管理界面新增筛选能力", "新增自定义瞄具管理功能"], }, + { + title: "v0.0.5", + latest: true, + subtitle: "这个版本引入了一些新的能力,并修复了一些问题", + description: ["优化了代码结构,对较大文件的解压处理更加快速"], + }, ]; From 4e181be3fb52d8210ff73ab703e6f3717d312c36 Mon Sep 17 00:00:00 2001 From: axiangcoding Date: Thu, 13 Jun 2024 14:16:42 +0800 Subject: [PATCH 02/12] update deps --- package.json | 12 +++--- yarn.lock | 116 ++++++++++++++++++++++++++------------------------- 2 files changed, 66 insertions(+), 62 deletions(-) diff --git a/package.json b/package.json index 72fd95b..c26fe6c 100644 --- a/package.json +++ b/package.json @@ -15,19 +15,19 @@ "dependencies": { "@tauri-apps/api": "^1", "vite-plugin-vuetify": "^2.0.3", - "vue": "^3.3.4", + "vue": "^3.4.27", "vue-i18n": "9", - "vue-router": "4", - "vuetify": "^3.6.8" + "vue-router": "^4.3.3", + "vuetify": "^3.6.9" }, "devDependencies": { "@mdi/font": "^7.4.47", "@tauri-apps/cli": "^1", "@vitejs/plugin-vue": "^5.0.4", "prettier": "3.3.2", - "sass": "^1.77.4", + "sass": "^1.77.5", "typescript": "^5.0.2", - "vite": "^5.0.0", - "vue-tsc": "^1.8.5" + "vite": "^5.2.13", + "vue-tsc": "^2.0.21" } } diff --git a/yarn.lock b/yarn.lock index a4020d1..9b12f53 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3,9 +3,9 @@ "@babel/parser@^7.24.4": - version "7.24.6" - resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.24.6.tgz#5e030f440c3c6c78d195528c3b688b101a365328" - integrity sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q== + version "7.24.7" + resolved "https://registry.npmmirror.com/@babel/parser/-/parser-7.24.7.tgz#9a5226f92f0c5c8ead550b750f5608e766c8ce85" + integrity sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw== "@esbuild/aix-ppc64@0.20.2": version "0.20.2" @@ -314,27 +314,28 @@ resolved "https://registry.npmmirror.com/@vitejs/plugin-vue/-/plugin-vue-5.0.5.tgz#e3dc11e427d4b818b7e3202766ad156e3d5e2eaa" integrity sha512-LOjm7XeIimLBZyzinBQ6OSm3UBCNVCpLkxGC0oWmm2YPzVZoxMsdvNVimLTBzpAnR9hl/yn1SHGuRfe6/Td9rQ== -"@volar/language-core@1.11.1", "@volar/language-core@~1.11.1": - version "1.11.1" - resolved "https://registry.npmmirror.com/@volar/language-core/-/language-core-1.11.1.tgz#ecdf12ea8dc35fb8549e517991abcbf449a5ad4f" - integrity sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw== +"@volar/language-core@2.3.0", "@volar/language-core@~2.3.0-alpha.15": + version "2.3.0" + resolved "https://registry.npmmirror.com/@volar/language-core/-/language-core-2.3.0.tgz#ffb9b64c8b19d7f45b1fdcd9ae9d98d94bad7179" + integrity sha512-pvhL24WUh3VDnv7Yw5N1sjhPtdx7q9g+Wl3tggmnkMcyK8GcCNElF2zHiKznryn0DiUGk+eez/p2qQhz+puuHw== dependencies: - "@volar/source-map" "1.11.1" + "@volar/source-map" "2.3.0" -"@volar/source-map@1.11.1", "@volar/source-map@~1.11.1": - version "1.11.1" - resolved "https://registry.npmmirror.com/@volar/source-map/-/source-map-1.11.1.tgz#535b0328d9e2b7a91dff846cab4058e191f4452f" - integrity sha512-hJnOnwZ4+WT5iupLRnuzbULZ42L7BWWPMmruzwtLhJfpDVoZLjNBxHDi2sY2bgZXCKlpU5XcsMFoYrsQmPhfZg== +"@volar/source-map@2.3.0": + version "2.3.0" + resolved "https://registry.npmmirror.com/@volar/source-map/-/source-map-2.3.0.tgz#faf4df8f10ca40788f03c35eed3e2b7848110cc9" + integrity sha512-G/228aZjAOGhDjhlyZ++nDbKrS9uk+5DMaEstjvzglaAw7nqtDyhnQAsYzUg6BMP9BtwZ59RIw5HGePrutn00Q== dependencies: - muggle-string "^0.3.1" + muggle-string "^0.4.0" -"@volar/typescript@~1.11.1": - version "1.11.1" - resolved "https://registry.npmmirror.com/@volar/typescript/-/typescript-1.11.1.tgz#ba86c6f326d88e249c7f5cfe4b765be3946fd627" - integrity sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ== +"@volar/typescript@~2.3.0-alpha.15": + version "2.3.0" + resolved "https://registry.npmmirror.com/@volar/typescript/-/typescript-2.3.0.tgz#00306942e95e2e22fed8daf73ec386cd72601ecf" + integrity sha512-PtUwMM87WsKVeLJN33GSTUjBexlKfKgouWlOUIv7pjrOnTwhXHZNSmpc312xgXdTjQPpToK6KXSIcKu9sBQ5LQ== dependencies: - "@volar/language-core" "1.11.1" + "@volar/language-core" "2.3.0" path-browserify "^1.0.1" + vscode-uri "^3.0.8" "@vue/compiler-core@3.4.27": version "3.4.27" @@ -347,7 +348,7 @@ estree-walker "^2.0.2" source-map-js "^1.2.0" -"@vue/compiler-dom@3.4.27", "@vue/compiler-dom@^3.3.0": +"@vue/compiler-dom@3.4.27", "@vue/compiler-dom@^3.4.0": version "3.4.27" resolved "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.27.tgz#d51d35f40d00ce235d7afc6ad8b09dfd92b1cc1c" integrity sha512-kUTvochG/oVgE1w5ViSr3KUBh9X7CWirebA3bezTbB5ZKBQZwR2Mwj9uoSKRMFcz4gSMzzLXBPD6KpCLb9nvWw== @@ -388,18 +389,16 @@ resolved "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.2.tgz#a5a17377ca810c7f0153232ff1dcfa25bd5694be" integrity sha512-134clD8u7cBBXdmBbXI282gHGF7T/eAbD/G7mAK2llQF62IbI4ny28IVamZVMoJSvfImC2Xxnj732hXkJvUj6g== -"@vue/language-core@1.8.27": - version "1.8.27" - resolved "https://registry.npmmirror.com/@vue/language-core/-/language-core-1.8.27.tgz#2ca6892cb524e024a44e554e4c55d7a23e72263f" - integrity sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA== +"@vue/language-core@2.0.21": + version "2.0.21" + resolved "https://registry.npmmirror.com/@vue/language-core/-/language-core-2.0.21.tgz#882667d0c9f07bc884f163e75eed666234df77fe" + integrity sha512-vjs6KwnCK++kIXT+eI63BGpJHfHNVJcUCr3RnvJsccT3vbJnZV5IhHR2puEkoOkIbDdp0Gqi1wEnv3hEd3WsxQ== dependencies: - "@volar/language-core" "~1.11.1" - "@volar/source-map" "~1.11.1" - "@vue/compiler-dom" "^3.3.0" - "@vue/shared" "^3.3.0" + "@volar/language-core" "~2.3.0-alpha.15" + "@vue/compiler-dom" "^3.4.0" + "@vue/shared" "^3.4.0" computeds "^0.0.1" minimatch "^9.0.3" - muggle-string "^0.3.1" path-browserify "^1.0.1" vue-template-compiler "^2.7.14" @@ -435,7 +434,7 @@ "@vue/compiler-ssr" "3.4.27" "@vue/shared" "3.4.27" -"@vue/shared@3.4.27", "@vue/shared@^3.3.0": +"@vue/shared@3.4.27", "@vue/shared@^3.4.0": version "3.4.27" resolved "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.27.tgz#f05e3cd107d157354bb4ae7a7b5fc9cf73c63b50" integrity sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA== @@ -627,10 +626,10 @@ ms@2.1.2: resolved "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -muggle-string@^0.3.1: - version "0.3.1" - resolved "https://registry.npmmirror.com/muggle-string/-/muggle-string-0.3.1.tgz#e524312eb1728c63dd0b2ac49e3282e6ed85963a" - integrity sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg== +muggle-string@^0.4.0: + version "0.4.1" + resolved "https://registry.npmmirror.com/muggle-string/-/muggle-string-0.4.1.tgz#3b366bd43b32f809dc20659534dd30e7c8a0d328" + integrity sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ== nanoid@^3.3.7: version "3.3.7" @@ -703,10 +702,10 @@ rollup@^4.13.0: "@rollup/rollup-win32-x64-msvc" "4.18.0" fsevents "~2.3.2" -sass@^1.77.4: - version "1.77.4" - resolved "https://registry.npmmirror.com/sass/-/sass-1.77.4.tgz#92059c7bfc56b827c56eb116778d157ec017a5cd" - integrity sha512-vcF3Ckow6g939GMA4PeU7b2K/9FALXk2KF9J87txdHzXbUF9XRQRwSxcAs/fGaTnJeBFd7UoV22j3lzMLdM0Pw== +sass@^1.77.5: + version "1.77.5" + resolved "https://registry.npmmirror.com/sass/-/sass-1.77.5.tgz#5f9009820297521356e962c0bed13ee36710edfe" + integrity sha512-oDfX1mukIlxacPdQqNb6mV2tVCrnE+P3nVYioy72V5tlk56CPNcO4TCuFcaCRKKfJ1M3lH95CleRS+dVKL2qMg== dependencies: chokidar ">=3.0.0 <4.0.0" immutable "^4.0.0" @@ -748,10 +747,10 @@ vite-plugin-vuetify@^2.0.3: debug "^4.3.3" upath "^2.0.1" -vite@^5.0.0: - version "5.2.12" - resolved "https://registry.npmmirror.com/vite/-/vite-5.2.12.tgz#3536c93c58ba18edea4915a2ac573e6537409d97" - integrity sha512-/gC8GxzxMK5ntBwb48pR32GGhENnjtY30G4A0jemunsBkiEZFw60s8InGpN8gkhHEkjnRK1aSAxeQgwvFhUHAA== +vite@^5.2.13: + version "5.2.13" + resolved "https://registry.npmmirror.com/vite/-/vite-5.2.13.tgz#945ababcbe3d837ae2479c29f661cd20bc5e1a80" + integrity sha512-SSq1noJfY9pR3I1TUENL3rQYDQCFqgD+lM6fTRAM8Nv6Lsg5hDLaXkjETVeBt+7vZBCMoibD+6IWnT2mJ+Zb/A== dependencies: esbuild "^0.20.1" postcss "^8.4.38" @@ -759,6 +758,11 @@ vite@^5.0.0: optionalDependencies: fsevents "~2.3.3" +vscode-uri@^3.0.8: + version "3.0.8" + resolved "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.0.8.tgz#1770938d3e72588659a172d0fd4642780083ff9f" + integrity sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw== + vue-i18n@9: version "9.13.1" resolved "https://registry.npmmirror.com/vue-i18n/-/vue-i18n-9.13.1.tgz#a292c8021b7be604ebfca5609ae1f8fafe5c36d7" @@ -768,10 +772,10 @@ vue-i18n@9: "@intlify/shared" "9.13.1" "@vue/devtools-api" "^6.5.0" -vue-router@4: - version "4.3.2" - resolved "https://registry.npmmirror.com/vue-router/-/vue-router-4.3.2.tgz#08096c7765dacc6832f58e35f7a081a8b34116a7" - integrity sha512-hKQJ1vDAZ5LVkKEnHhmm1f9pMiWIBNGF5AwU67PdH7TyXCj/a4hTccuUuYCAMgJK6rO/NVYtQIEN3yL8CECa7Q== +vue-router@^4.3.3: + version "4.3.3" + resolved "https://registry.npmmirror.com/vue-router/-/vue-router-4.3.3.tgz#7505509d429a36694b12ba1f6530016c5ce5f6bf" + integrity sha512-8Q+u+WP4N2SXY38FDcF2H1dUEbYVHVPtPCPZj/GTZx8RCbiB8AtJP9+YIxn4Vs0svMTNQcLIzka4GH7Utkx9xQ== dependencies: "@vue/devtools-api" "^6.5.1" @@ -783,16 +787,16 @@ vue-template-compiler@^2.7.14: de-indent "^1.0.2" he "^1.2.0" -vue-tsc@^1.8.5: - version "1.8.27" - resolved "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-1.8.27.tgz#feb2bb1eef9be28017bb9e95e2bbd1ebdd48481c" - integrity sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg== +vue-tsc@^2.0.21: + version "2.0.21" + resolved "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-2.0.21.tgz#c574a2c20e8a5e5643af546c6051319cdf983239" + integrity sha512-E6x1p1HaHES6Doy8pqtm7kQern79zRtIewkf9fiv7Y43Zo4AFDS5hKi+iHi2RwEhqRmuiwliB1LCEFEGwvxQnw== dependencies: - "@volar/typescript" "~1.11.1" - "@vue/language-core" "1.8.27" + "@volar/typescript" "~2.3.0-alpha.15" + "@vue/language-core" "2.0.21" semver "^7.5.4" -vue@^3.3.4: +vue@^3.4.27: version "3.4.27" resolved "https://registry.npmmirror.com/vue/-/vue-3.4.27.tgz#40b7d929d3e53f427f7f5945386234d2854cc2a1" integrity sha512-8s/56uK6r01r1icG/aEOHqyMVxd1bkYcSe9j8HcKtr/xTOFWvnzIVTehNW+5Yt89f+DLBe4A569pnZLS5HzAMA== @@ -803,7 +807,7 @@ vue@^3.3.4: "@vue/server-renderer" "3.4.27" "@vue/shared" "3.4.27" -vuetify@^3.6.8: - version "3.6.8" - resolved "https://registry.npmmirror.com/vuetify/-/vuetify-3.6.8.tgz#89ab0b68aa5488c7b54a04fa4a02a1b802892aaa" - integrity sha512-j0v0iTeSVRj2ZEM9Q8HxejHxmxrQLYQSalhH82hfcraORaiDoqf1XV05N3P5ERXkKiJjJc/LfxFAUUvYSldxeg== +vuetify@^3.6.9: + version "3.6.9" + resolved "https://registry.npmmirror.com/vuetify/-/vuetify-3.6.9.tgz#6c063fa6e8097e854406467db25e8d8a40e26e71" + integrity sha512-LVIZL0OCwzg3Aw2F8nT1rK/renpTPOcDEPe5E002Vj+VjXwsCNqwwxNteGfrcNlp0vgIJ8WusMvaxp69UJ3NJg== From 88b69e5c9956d34127a409375369520bf56e8e04 Mon Sep 17 00:00:00 2001 From: axiangcoding Date: Thu, 13 Jun 2024 14:22:29 +0800 Subject: [PATCH 03/12] update --- src/App.vue | 6 +- src/components/card/FunctionCard.vue | 37 +++++++++ src/components/card/LinkCard.vue | 50 ++++++++++++ src/components/dialog/BugReportDialog.vue | 6 +- src/pages/About.vue | 8 +- src/pages/Home.vue | 98 ++++++++++++++--------- 6 files changed, 157 insertions(+), 48 deletions(-) create mode 100644 src/components/card/FunctionCard.vue create mode 100644 src/components/card/LinkCard.vue diff --git a/src/App.vue b/src/App.vue index 3990057..f347ede 100644 --- a/src/App.vue +++ b/src/App.vue @@ -69,13 +69,13 @@ async function jumpToBiliBili() { 战雷小工具 自定义涂装管理 自定义瞄具管理 @@ -88,7 +88,7 @@ async function jumpToBiliBili() { 关于 diff --git a/src/components/card/FunctionCard.vue b/src/components/card/FunctionCard.vue new file mode 100644 index 0000000..a9059f5 --- /dev/null +++ b/src/components/card/FunctionCard.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/src/components/card/LinkCard.vue b/src/components/card/LinkCard.vue new file mode 100644 index 0000000..e96f29c --- /dev/null +++ b/src/components/card/LinkCard.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/src/components/dialog/BugReportDialog.vue b/src/components/dialog/BugReportDialog.vue index d9a25d8..da821da 100644 --- a/src/components/dialog/BugReportDialog.vue +++ b/src/components/dialog/BugReportDialog.vue @@ -7,13 +7,13 @@ const show = defineModel();