From ac4d93b172735268aadc630716ee4d8b4f5f746b Mon Sep 17 00:00:00 2001 From: ASLant <77436463+Y-ASLant@users.noreply.github.com> Date: Sat, 31 Jan 2026 16:03:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=B8=8E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除过时代码,迁移 ESLint 到 v9 新配置格式 - 修复已废弃的 overflow: overlay CSS 属性 - 新增 LZMA 压缩选项,提升压缩率 - 更新弹窗布局:两列显示,适配小窗口 - 优化更新功能:用户可选择便携版或安装版 - 调整界面间距与样式,提升视觉效果 --- eslint.config.js | 8 ++- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/src/main.rs | 20 ++++---- src-tauri/tauri.conf.json | 2 +- ui/index.html | 26 +++++----- ui/js/main.js | 101 ++++++++++++++++++++++++-------------- 8 files changed, 99 insertions(+), 64 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 2dc43fb..7212850 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -25,7 +25,13 @@ export default [ indent: ['error', 4], quotes: ['error', 'single', { avoidEscape: true }], semi: ['error', 'never'], - 'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], + 'no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^currentUpdateInfo_$', + }, + ], 'no-constant-condition': ['warn', { checkLoops: false }], 'no-console': 'off', }, diff --git a/package.json b/package.json index ee62ca9..600326a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "UPX-Tools", - "version": "1.3.0", + "version": "1.4.5", "type": "module", "description": "UPX 可视化加壳/脱壳工具", "scripts": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 6c816a6..15c1e8b 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -4,7 +4,7 @@ version = 4 [[package]] name = "UPX-Tools" -version = "1.3.0" +version = "1.4.5" dependencies = [ "encoding_rs", "reqwest", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 5f0c6c4..bf398e3 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "UPX-Tools" -version = "1.3.0" +version = "1.4.5" description = "UPX 可视化加壳脱壳工具" authors = ["ASLant"] edition = "2021" diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index f49f1f8..43b084d 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -559,8 +559,7 @@ struct UpdateInfo { release_name: String, release_notes: String, published_at: String, - download_url: Option, - download_size: Option, + assets: Vec, } #[tauri::command] @@ -605,13 +604,17 @@ async fn check_update() -> Result { let has_update = version_compare(latest, current); - // 查找便携版或安装包下载链接 - let (download_url, download_size) = release + // 过滤出 Windows 相关的下载资源 + let assets: Vec = release .assets .iter() - .find(|a| a.name.ends_with("-portable.exe") || a.name.ends_with("-setup.exe")) - .map(|a| (Some(a.browser_download_url.clone()), Some(a.size))) - .unwrap_or((None, None)); + .filter(|a| { + a.name.ends_with("-portable.exe") + || a.name.ends_with("-setup.exe") + || a.name.ends_with(".msi") + }) + .cloned() + .collect(); Ok(UpdateInfo { has_update, @@ -621,8 +624,7 @@ async fn check_update() -> Result { release_name: release.name, release_notes: release.body.unwrap_or_default(), published_at: release.published_at, - download_url, - download_size, + assets, }) } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 6186fff..6159fb8 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "UPX-Tools", - "version": "1.3.0", + "version": "1.4.5", "identifier": "top.aslant.upxgui", "build": { "beforeDevCommand": "", diff --git a/ui/index.html b/ui/index.html index 491d474..cd5a954 100644 --- a/ui/index.html +++ b/ui/index.html @@ -390,7 +390,7 @@ class="hidden fixed inset-0 bg-foreground/80 flex items-center justify-center z-50 backdrop-blur-sm modal-backdrop" >