From 13250af61d32fbbdf76183c5736b87a5345c2cce Mon Sep 17 00:00:00 2001 From: axiangcoding Date: Sun, 14 Jul 2024 01:16:13 +0800 Subject: [PATCH] Release version 0.1.0 (#33) - fixed #32 - update depends --- CHANGELOG.md | 65 +--- README.md | 7 +- README.zh-CN.md | 7 +- package.json | 10 +- src-tauri/Cargo.lock | 229 ++++++------ src-tauri/src/commands/setting.rs | 38 ++ src-tauri/src/config.rs | 2 + src-tauri/src/main.rs | 1 + src-tauri/src/ret_code.rs | 2 + src-tauri/tauri.conf.json | 2 +- src/App.vue | 119 +++++-- src/components/card/LinkCard.vue | 11 +- src/components/card/UserSightCard.vue | 17 +- src/components/card/UserSkinCard.vue | 19 +- src/components/dialog/BugReportDialog.vue | 13 +- src/components/dialog/LoadUserSightDialog.vue | 25 +- src/components/dialog/LoadUserSkinDialog.vue | 24 +- .../wt_ext_cli_cmd_card/HelpCmd.vue | 40 ++- .../UnpackDxpAndGrpCmd.vue | 55 ++- .../wt_ext_cli_cmd_card/UnpackRawBlkCmd.vue | 47 ++- .../wt_ext_cli_cmd_card/UnpackVromf.vue | 57 +-- .../wt_ext_cli_cmd_card/VersionCmd.vue | 40 ++- .../wt_ext_cli_cmd_card/VromfVersion.vue | 42 ++- src/error_msg.ts | 25 +- src/i18n.ts | 16 + src/locales/en_us.json | 327 ++++++++++++++++++ src/locales/zh_cn.json | 327 ++++++++++++++++++ src/main.ts | 4 +- src/pages/Home.vue | 97 +++--- src/pages/Setting.vue | 94 ++--- src/pages/WTExtCli.vue | 52 +-- src/pages/WTSights.vue | 99 +++--- src/pages/WTSkins.vue | 99 +++--- src/schema.ts | 7 + yarn.lock | 146 ++++---- 35 files changed, 1545 insertions(+), 620 deletions(-) create mode 100644 src/i18n.ts create mode 100644 src/locales/en_us.json create mode 100644 src/locales/zh_cn.json diff --git a/CHANGELOG.md b/CHANGELOG.md index da83a54..2086bd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ Change log of WT-ToolKit. All notable changes to this project will be documented in this file. +For version before v0.0.6, the change log is not available. + -## [v0.0.6] - 2024-07-01 +## [v0.1.0] - 2024-07-14 ### Added -- Added GUI support for [wt_ext_cli](https://github.com/Warthunder-Open-Source-Foundation/wt_ext_cli), and some bug fixes. -- Support update checking +- Add English and Chinese language support! You can now switch between English and Chinese. +- Add new useful links to the main page ### Changed -- Configuration file reading and writing has been refactored for faster reads -- **Breaking Change**: Renamed project name from `wt-helper-app` to `wt-toolkit`, this will cause the configuration file to be reset, please reconfigure the configuration file after the update +- Refactor the code to support multiple languages +- Adjust some text to make it more readable ### Removed -- Remove useless configuration entries +- Hide the about page ### Fixed -- Upgraded versions of dependency libraries to improve security - -## [v0.0.5] - 2024-06-14 - -### Added - -- New design of the homepage, added quick links in the homepage - -### Changed - -- Refactored the code and optimized the decompression speed of large files - -## [v0.0.4] - 2024-06-13 +## [v0.0.6] - 2024-07-01 ### Added -- Added custom sight management function -- Added the ability to filter custom skins - -## [v0.0.3] - 2024-06-08 +- Added GUI support for [wt_ext_cli](https://github.com/Warthunder-Open-Source-Foundation/wt_ext_cli), and some bug fixes. +- Support update checking ### Changed -- Custom skins management support to identify nested catalogues - -### Fixed - -- Fixed some bugs in the custom skins management - -## [v0.0.2] - 2024-06-07 +- Configuration file reading and writing has been refactored for faster reads +- **Breaking Change**: Renamed project name from `wt-helper-app` to `wt-toolkit`, this will cause the configuration file to be reset, please reconfigure the configuration file after the update -### Changed +### Removed -- Optimisation of the custom skins GUI +- Remove useless configuration entries ### Fixed -- Fixed the problem of not being able to set configuration items. - -## [v0.0.1] - 2024-06-07 - -### Added - -- First release of WT-ToolKit! Where the magic begins. -- Basic construction of the project -- War Thunder Custom Skin Management +- Upgraded versions of dependency libraries to improve security +[v0.1.0]: https://github.com/axiangcoding/WT-Toolkit/compare/v0.0.6...v0.1.0 [v0.0.6]: https://github.com/axiangcoding/WT-Toolkit/compare/v0.0.5...v0.0.6 -[v0.0.5]: https://github.com/axiangcoding/WT-Toolkit/compare/v0.0.4...v0.0.5 -[v0.0.4]: https://github.com/axiangcoding/WT-Toolkit/compare/v0.0.3...v0.0.4 -[v0.0.3]: https://github.com/axiangcoding/WT-Toolkit/compare/v0.0.2...v0.0.3 -[v0.0.2]: https://github.com/axiangcoding/WT-Toolkit/compare/v0.0.1...v0.0.2 -[v0.0.1]: https://github.com/axiangcoding/WT-Toolkit/tree/v0.0.1 diff --git a/README.md b/README.md index eec14cc..547cdf7 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,9 @@ This is a toolkit designed for War Thunder players to provide some useful featur ## Features -We are supporting the following features now: - - [x] User customised skin management - [x] User customised sight management - -And we are planning to support the following features in the future: - -- [ ] GUI support for [wt_ext_cli](https://github.com/Warthunder-Open-Source-Foundation/wt_ext_cli) +- [x] GUI support for [wt_ext_cli](https://github.com/Warthunder-Open-Source-Foundation/wt_ext_cli) - [ ] Multi-language support ## Installation diff --git a/README.zh-CN.md b/README.zh-CN.md index 0c47375..f8e7d9e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -13,14 +13,9 @@ ## 功能 -我们现在支持以下功能: - - [x] 用户自定义皮肤管理 - [x] 用户自定义瞄准镜管理 - -我们计划未来支持以下功能: - -- [ ] 为 [wt_ext_cli](https://github.com/Warthunder-Open-Source-Foundation/wt_ext_cli) 提供 GUI 支持 +- [x] 为 [wt_ext_cli](https://github.com/Warthunder-Open-Source-Foundation/wt_ext_cli) 提供 GUI 支持 - [ ] 多语言支持 ## 安装 diff --git a/package.json b/package.json index fad40fe..b53a554 100644 --- a/package.json +++ b/package.json @@ -13,21 +13,21 @@ "tauri": "tauri" }, "dependencies": { - "@tauri-apps/api": "^1", + "@tauri-apps/api": "^1.6.0", "vite-plugin-vuetify": "^2.0.3", "vue": "^3.4.27", "vue-i18n": "9", - "vue-router": "^4.3.3", + "vue-router": "^4.4.0", "vuetify": "^3.6.11" }, "devDependencies": { "@mdi/font": "^7.4.47", - "@tauri-apps/cli": "^1", + "@tauri-apps/cli": "^1.6.0", "@vitejs/plugin-vue": "^5.0.4", "prettier": "3.3.2", "sass": "^1.77.6", - "typescript": "^5.0.2", - "vite": "^5.3.2", + "typescript": "^5.5.3", + "vite": "^5.3.3", "vue-tsc": "^2.0.24" }, "packageManager": "yarn@1.22.19" diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 68ddf47..4275b6c 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -287,9 +287,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" dependencies = [ "serde", ] @@ -351,9 +351,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.102" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779e6b7d17797c0b42023d417228c02889300190e700cb074c3438d9c541d332" +checksum = "47de7e88bbbd467951ae7f5a6f34f70d1b4d9cfce53d5fd70f74ebe118b3db56" dependencies = [ "jobserver", "libc", @@ -412,7 +412,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -630,7 +630,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -640,14 +640,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] name = "darling" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -655,27 +655,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] name = "darling_macro" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -702,7 +702,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -715,7 +715,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -764,7 +764,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -1000,7 +1000,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -1473,9 +1473,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.29" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -1765,12 +1765,6 @@ dependencies = [ "libc", ] -[[package]] -name = "line-wrap" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -2144,7 +2138,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -2216,7 +2210,7 @@ dependencies = [ "libc", "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2345,7 +2339,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -2395,13 +2389,12 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plist" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" +checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "indexmap 2.2.6", - "line-wrap", "quick-xml", "serde", "time", @@ -2489,9 +2482,9 @@ dependencies = [ [[package]] name = "quick-xml" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" dependencies = [ "memchr", ] @@ -2864,29 +2857,29 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] name = "serde_json" -version = "1.0.119" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8eddb61f0697cc3989c5d64b452f5488e2b8a60fd7d5076a3045076ffef8cb0" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "indexmap 2.2.6", "itoa 1.0.11", @@ -2902,7 +2895,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -2928,9 +2921,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.8.1" +version = "3.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +checksum = "e73139bc5ec2d45e6c5fd85be5a46949c1c39a4c18e56915f5eb4c12f975e377" dependencies = [ "base64 0.22.1", "chrono", @@ -2946,14 +2939,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.8.1" +version = "3.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +checksum = "b80d3d6b56b64335c0180e5ffde23b3c5e08c14c585b51a15bd0e95393f46703" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -3187,9 +3180,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.68" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -3320,15 +3313,15 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" [[package]] name = "tauri" -version = "1.6.8" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77567d2b3b74de4588d544147142d02297f3eaa171a25a065252141d8597a516" +checksum = "336bc661a3f3250853fa83c6e5245449ed1c26dce5dcb28bdee7efedf6278806" dependencies = [ "anyhow", "base64 0.21.7", @@ -3383,9 +3376,9 @@ dependencies = [ [[package]] name = "tauri-build" -version = "1.5.2" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab30cba12974d0f9b09794f61e72cad6da2142d3ceb81e519321bab86ce53312" +checksum = "b0c6ec7a5c3296330c7818478948b422967ce4649094696c985f61d50076d29c" dependencies = [ "anyhow", "cargo_toml", @@ -3402,9 +3395,9 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "1.4.3" +version = "1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a1d90db526a8cdfd54444ad3f34d8d4d58fa5c536463915942393743bd06f8" +checksum = "c1aed706708ff1200ec12de9cfbf2582b5d8ec05f6a7293911091effbd22036b" dependencies = [ "base64 0.21.7", "brotli", @@ -3428,9 +3421,9 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "1.4.4" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a582d75414250122e4a597b9dd7d3c910a2c77906648fc2ac9353845ff0feec" +checksum = "b88f831d2973ae4f81a706a0004e67dac87f2e4439973bbe98efbd73825d8ede" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -3442,9 +3435,9 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7ffddf36d450791018e63a3ddf54979b9581d9644c584a5fb5611e6b5f20b4" +checksum = "3068ed62b63dedc705558f4248c7ecbd5561f0f8050949859ea0db2326f26012" dependencies = [ "gtk", "http", @@ -3463,9 +3456,9 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "0.14.8" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1989b3b4d611f5428b3414a4abae6fa6df30c7eb8ed33250ca90a5f7e5bb3655" +checksum = "d4c3db170233096aa30330feadcd895bf9317be97e624458560a20e814db7955" dependencies = [ "cocoa", "gtk", @@ -3483,9 +3476,9 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "1.5.4" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "450b17a7102e5d46d4bdabae0d1590fd27953e704e691fc081f06c06d2253b35" +checksum = "2826db448309d382dac14d520f0c0a40839b87b57b977e59cf5f296b3ace6a93" dependencies = [ "brotli", "ctor", @@ -3561,22 +3554,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -3624,9 +3617,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -3664,7 +3657,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -3720,7 +3713,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.14", + "toml_edit 0.22.15", ] [[package]] @@ -3747,9 +3740,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.14" +version = "0.22.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" dependencies = [ "indexmap 2.2.6", "serde", @@ -3783,7 +3776,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -3890,9 +3883,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom 0.2.15", ] @@ -3999,7 +3992,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", "wasm-bindgen-shared", ] @@ -4033,7 +4026,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4235,7 +4228,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4284,7 +4277,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4304,18 +4297,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -4330,7 +4323,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6998aa457c9ba8ff2fb9f13e9d2a930dabcea28f1d0ab94d687d8b3654844515" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4347,9 +4340,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4377,9 +4370,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4407,15 +4400,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4443,9 +4436,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4473,9 +4466,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -4491,9 +4484,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -4521,9 +4514,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -4670,7 +4663,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.68", + "syn 2.0.71", ] [[package]] @@ -4729,27 +4722,27 @@ dependencies = [ [[package]] name = "zstd" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.1.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +checksum = "fa556e971e7b568dc775c136fc9de8c779b1c2fc3a63defaafadffdbd3181afa" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.11+zstd.1.5.6" +version = "2.0.12+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" +checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" dependencies = [ "cc", "pkg-config", diff --git a/src-tauri/src/commands/setting.rs b/src-tauri/src/commands/setting.rs index 39b1903..64e2263 100644 --- a/src-tauri/src/commands/setting.rs +++ b/src-tauri/src/commands/setting.rs @@ -32,6 +32,44 @@ pub fn save_app_config( Ok(()) } +#[tauri::command] +pub fn update_app_config( + app: tauri::AppHandle, + state: tauri::State, + key: String, + value: String, +) -> Result<(), RetCode> { + // 获取可变引用 + let mut state_ref = state.lock().unwrap(); + + // 从状态中提取配置 + let mut config = state_ref.as_mut().unwrap().config.clone(); + + // 根据键更新配置 + match key.as_str() { + "language" => config.language = Some(value), + _ => return Err(RetCode::InvalidSettingKey), + } + + // 更新状态中的配置 + state_ref.as_mut().unwrap().config = config.clone(); + + // 释放状态引用以允许保存 + drop(state_ref); + + // 保存应用配置 + let app_config_dir = app + .path_resolver() + .app_config_dir() + .ok_or(RetCode::SaveAppSettingsFailed)?; + config::save_config(&app_config_dir, &config).map_err(|e| { + error!("save config error: {}", e); + RetCode::SaveAppSettingsFailed + })?; + + Ok(()) +} + #[tauri::command] pub fn get_app_config_dir(app: tauri::AppHandle) -> Result { let app_config_dir = app diff --git a/src-tauri/src/config.rs b/src-tauri/src/config.rs index 03265b2..86e69eb 100644 --- a/src-tauri/src/config.rs +++ b/src-tauri/src/config.rs @@ -9,6 +9,7 @@ pub struct AppConfig { pub wt_root_path: Option, pub wt_setting_path: Option, pub wt_ext_cli_path: Option, + pub language: Option, } const SETTING_FILE: &str = "config.json"; @@ -41,6 +42,7 @@ pub fn check_and_create_config_file(base_path: &PathBuf) -> Result<(), Box -import { onMounted, ref } from "vue"; +import { computed, onMounted, ref } from "vue"; import { getVersion } from "@tauri-apps/api/app"; import { open } from "@tauri-apps/api/shell"; import BugReportDialog from "./components/dialog/BugReportDialog.vue"; +import { useI18n } from "vue-i18n"; +import { invoke } from "@tauri-apps/api"; +import { AppSettings } from "./schema"; const appVersion = ref(""); const drawer = ref(false); const feedbackDialog = ref(false); -const homeList = [ +const { t, locale } = useI18n(); + +const homeList = computed(() => [ { icon: "mdi-home", - title: "主页", + title: t("app.nav_drawer.home"), to: "/", }, -]; +]); -const wtTool = [ +const wtTool = computed(() => [ { icon: "mdi-format-paint", - title: "自定义涂装管理", + title: t("app.nav_drawer.wt_skins"), to: "/wt-skins", }, { icon: "mdi-crosshairs", - title: "自定义瞄具管理", + title: t("app.nav_drawer.wt_sight"), to: "/wt-sight", }, { icon: "mdi-package-variant", - title: "解包工具", + title: t("app.nav_drawer.wt_ext_cli"), to: "/wt-ext-cli", }, -]; +]); -const appInfo = [ +const appInfo = computed(() => [ { icon: "mdi-cog", - title: "设置", + title: t("app.nav_drawer.settings"), to: "/setting", }, + // { + // icon: "mdi-information", + // title: t("app.nav_drawer.about"), + // to: "/about", + // }, +]); + +const followLinks = computed(() => [ + { + text: t("app.follow_links.bilibili"), + url: "https://space.bilibili.com/8696650", + icon: "mdi-television-classic", + }, { - icon: "mdi-information", - title: "关于", - to: "/about", + text: t("app.follow_links.github"), + url: "https://github.com/axiangcoding/WT-Toolkit", + icon: "mdi-github", }, -]; +]); onMounted(async () => { appVersion.value = await getVersion(); + let cfg: AppSettings = await invoke("get_app_config"); + if (cfg.language) { + console.log(cfg.language); + locale.value = cfg.language; + } }); -async function jumpToBiliBili() { - await open("https://space.bilibili.com/8696650"); +async function jumpTo(url: string) { + await open(url); } -async function jumpToGithub() { - await open("https://github.com/axiangcoding/WT-Toolkit"); +async function switchLanguage(target: string) { + locale.value = target; + await invoke("update_app_config", { + key: "language", + value: target, + }); } @@ -68,31 +95,51 @@ async function jumpToGithub() { - 战雷工具箱 + {{ t("app.title") }} v{{ appVersion }}