diff --git a/UPDATELOG.md b/UPDATELOG.md index 5bec542..17236e4 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -1,3 +1,14 @@ +## v1.4.1 + +### Features + +- update clash meta core to newest 虚空终端(2023.11.23) +- delete clash core UI +- improve UI +- change Logo to original + +--- + ## v1.4.0 ### Features diff --git a/package.json b/package.json index 0aa2b2b..91eaa00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clash-verge", - "version": "1.4.0", + "version": "1.4.1", "license": "GPL-3.0", "scripts": { "dev": "tauri dev -f default-meta", @@ -42,6 +42,7 @@ "react-virtuoso": "^3.1.3", "recoil": "^0.7.6", "snarkdown": "^2.0.0", + "tar": "^6.2.0", "swr": "^1.3.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2573a4a..f55f381 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -80,6 +80,9 @@ dependencies: swr: specifier: ^1.3.0 version: 1.3.0(react@18.2.0) + tar: + specifier: ^6.2.0 + version: 6.2.0 devDependencies: "@actions/github": @@ -2180,6 +2183,14 @@ packages: fsevents: 2.3.2 dev: true + /chownr@2.0.0: + resolution: + { + integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==, + } + engines: { node: ">=10" } + dev: false + /clsx@2.0.0: resolution: { @@ -2578,6 +2589,16 @@ packages: universalify: 2.0.0 dev: true + /fs-minipass@2.1.0: + resolution: + { + integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==, + } + engines: { node: ">= 8" } + dependencies: + minipass: 3.3.6 + dev: false + /fsevents@2.3.2: resolution: { @@ -2992,6 +3013,44 @@ packages: brace-expansion: 1.1.11 dev: true + /minipass@3.3.6: + resolution: + { + integrity: sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==, + } + engines: { node: ">=8" } + dependencies: + yallist: 4.0.0 + dev: false + + /minipass@5.0.0: + resolution: + { + integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==, + } + engines: { node: ">=8" } + dev: false + + /minizlib@2.1.2: + resolution: + { + integrity: sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==, + } + engines: { node: ">= 8" } + dependencies: + minipass: 3.3.6 + yallist: 4.0.0 + dev: false + + /mkdirp@1.0.4: + resolution: + { + integrity: sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==, + } + engines: { node: ">=10" } + hasBin: true + dev: false + /monaco-editor@0.34.1: resolution: { @@ -3694,6 +3753,21 @@ packages: react: 18.2.0 dev: false + /tar@6.2.0: + resolution: + { + integrity: sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==, + } + engines: { node: ">=10" } + dependencies: + chownr: 2.0.0 + fs-minipass: 2.1.0 + minipass: 5.0.0 + minizlib: 2.1.2 + mkdirp: 1.0.4 + yallist: 4.0.0 + dev: false + /to-fast-properties@2.0.0: resolution: { @@ -3897,6 +3971,13 @@ packages: } dev: true + /yallist@4.0.0: + resolution: + { + integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==, + } + dev: false + /yaml@1.10.2: resolution: { diff --git a/scripts/check.mjs b/scripts/check.mjs index bc67719..48f1b1c 100644 --- a/scripts/check.mjs +++ b/scripts/check.mjs @@ -1,5 +1,6 @@ import fs from "fs-extra"; import zlib from "zlib"; +import tar from "tar"; import path from "path"; import AdmZip from "adm-zip"; import fetch from "node-fetch"; @@ -36,8 +37,8 @@ const CLASH_MAP = { }; */ /* ======= clash meta ======= */ -const META_URL_PREFIX = `https://github.com/wonfen/Clash.Meta/releases/download/`; -const META_VERSION = "2023.11.23"; +const META_URL_PREFIX = `https://github.com/wonfen/Clash.Meta/releases/download/latest`; +// const META_VERSION = "2023.11.23"; const META_MAP = { "win32-x64": "clash.meta-win-amd64", @@ -118,10 +119,14 @@ function clashS3() { function clashMeta() { const name = META_MAP[`${platform}-${arch}`]; const isWin = platform === "win32"; - const urlExt = isWin ? "zip" : "gz"; + /* const urlExt = isWin ? "zip" : "gz"; const downloadURL = `${META_URL_PREFIX}${META_VERSION}/${name}-${META_VERSION}.${urlExt}`; const exeFile = `${name}${isWin ? ".exe" : ""}`; - const zipFile = `${name}-${META_VERSION}.${urlExt}`; + const zipFile = `${name}-${META_VERSION}.${urlExt}`; */ + const urlExt = isWin ? "zip" : "tgz"; + const downloadURL = `${META_URL_PREFIX}/${name}.${urlExt}`; + const exeFile = isWin ? "虚空终端-win-amd64.exe" : name; + const zipFile = `${name}.${urlExt}`; return { name: "clash-meta", @@ -162,6 +167,26 @@ async function resolveSidecar(binInfo) { zip.extractAllTo(tempDir, true); await fs.rename(tempExe, sidecarPath); console.log(`[INFO]: "${name}" unzip finished`); + } else if (zipFile.endsWith(".tgz")) { + // tgz + await fs.mkdirp(tempDir); + await tar.extract({ + cwd: tempDir, + file: tempZip, + //strip: 1, // 可能需要根据实际的 .tgz 文件结构调整 + }); + const files = await fs.readdir(tempDir); + console.log(`[DEBUG]: "${name}" files in tempDir:`, files); + const extractedFile = files.find((file) => file.startsWith("虚空终端-")); + if (extractedFile) { + const extractedFilePath = path.join(tempDir, extractedFile); + await fs.rename(extractedFilePath, sidecarPath); + console.log(`[INFO]: "${name}" file renamed to "${sidecarPath}"`); + execSync(`chmod 755 ${sidecarPath}`); + console.log(`[INFO]: "${name}" chmod binary finished`); + } else { + throw new Error(`Expected file not found in ${tempDir}`); + } } else { // gz const readStream = fs.createReadStream(tempZip); diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index d886d54..ace2c9d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -547,7 +547,7 @@ dependencies = [ [[package]] name = "clash-verge" -version = "1.4.0" +version = "1.4.1" dependencies = [ "anyhow", "auto-launch", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 63128d8..f0f7f30 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "clash-verge" -version = "1.4.0" +version = "1.4.1" description = "clash verge" authors = ["zzzgydi"] license = "GPL-3.0" diff --git a/src-tauri/icons/128x128.png b/src-tauri/icons/128x128.png index a6ce5a8..be2533a 100644 Binary files a/src-tauri/icons/128x128.png and b/src-tauri/icons/128x128.png differ diff --git a/src-tauri/icons/128x128@2x.png b/src-tauri/icons/128x128@2x.png index 6d8bee5..3245891 100644 Binary files a/src-tauri/icons/128x128@2x.png and b/src-tauri/icons/128x128@2x.png differ diff --git a/src-tauri/icons/32x32.png b/src-tauri/icons/32x32.png index 95a12e7..1a93685 100644 Binary files a/src-tauri/icons/32x32.png and b/src-tauri/icons/32x32.png differ diff --git a/src-tauri/icons/Square107x107Logo.png b/src-tauri/icons/Square107x107Logo.png index 8413ed6..4240ea5 100644 Binary files a/src-tauri/icons/Square107x107Logo.png and b/src-tauri/icons/Square107x107Logo.png differ diff --git a/src-tauri/icons/Square142x142Logo.png b/src-tauri/icons/Square142x142Logo.png index 45a68bb..822b49b 100644 Binary files a/src-tauri/icons/Square142x142Logo.png and b/src-tauri/icons/Square142x142Logo.png differ diff --git a/src-tauri/icons/Square150x150Logo.png b/src-tauri/icons/Square150x150Logo.png index 2c28923..bb7e494 100644 Binary files a/src-tauri/icons/Square150x150Logo.png and b/src-tauri/icons/Square150x150Logo.png differ diff --git a/src-tauri/icons/Square284x284Logo.png b/src-tauri/icons/Square284x284Logo.png index fa662b7..9b0ec9f 100644 Binary files a/src-tauri/icons/Square284x284Logo.png and b/src-tauri/icons/Square284x284Logo.png differ diff --git a/src-tauri/icons/Square30x30Logo.png b/src-tauri/icons/Square30x30Logo.png index 1baad45..496a662 100644 Binary files a/src-tauri/icons/Square30x30Logo.png and b/src-tauri/icons/Square30x30Logo.png differ diff --git a/src-tauri/icons/Square310x310Logo.png b/src-tauri/icons/Square310x310Logo.png index c6cc9bf..c02df10 100644 Binary files a/src-tauri/icons/Square310x310Logo.png and b/src-tauri/icons/Square310x310Logo.png differ diff --git a/src-tauri/icons/Square44x44Logo.png b/src-tauri/icons/Square44x44Logo.png index 9318930..8ff531d 100644 Binary files a/src-tauri/icons/Square44x44Logo.png and b/src-tauri/icons/Square44x44Logo.png differ diff --git a/src-tauri/icons/Square71x71Logo.png b/src-tauri/icons/Square71x71Logo.png index dffeded..7829892 100644 Binary files a/src-tauri/icons/Square71x71Logo.png and b/src-tauri/icons/Square71x71Logo.png differ diff --git a/src-tauri/icons/Square89x89Logo.png b/src-tauri/icons/Square89x89Logo.png index 8ad7794..6b64990 100644 Binary files a/src-tauri/icons/Square89x89Logo.png and b/src-tauri/icons/Square89x89Logo.png differ diff --git a/src-tauri/icons/StoreLogo.png b/src-tauri/icons/StoreLogo.png index 603d0e5..15344c6 100644 Binary files a/src-tauri/icons/StoreLogo.png and b/src-tauri/icons/StoreLogo.png differ diff --git a/src-tauri/icons/icon-new.icns b/src-tauri/icons/icon-new.icns index b833040..b66e74e 100644 Binary files a/src-tauri/icons/icon-new.icns and b/src-tauri/icons/icon-new.icns differ diff --git a/src-tauri/icons/icon-new.png b/src-tauri/icons/icon-new.png deleted file mode 100644 index 93ccca1..0000000 Binary files a/src-tauri/icons/icon-new.png and /dev/null differ diff --git a/src-tauri/icons/icon-shrink.png b/src-tauri/icons/icon-shrink.png index 749bd3b..5ebfa38 100644 Binary files a/src-tauri/icons/icon-shrink.png and b/src-tauri/icons/icon-shrink.png differ diff --git a/src-tauri/icons/icon.icns b/src-tauri/icons/icon.icns index 847ee75..88df4a0 100644 Binary files a/src-tauri/icons/icon.icns and b/src-tauri/icons/icon.icns differ diff --git a/src-tauri/icons/icon.ico b/src-tauri/icons/icon.ico index 588878f..e406a78 100644 Binary files a/src-tauri/icons/icon.ico and b/src-tauri/icons/icon.ico differ diff --git a/src-tauri/icons/icon.png b/src-tauri/icons/icon.png index 5cb786e..cf91cf6 100644 Binary files a/src-tauri/icons/icon.png and b/src-tauri/icons/icon.png differ diff --git a/src-tauri/icons/tray-icon.ico b/src-tauri/icons/tray-icon.ico index 7088ed8..611c958 100644 Binary files a/src-tauri/icons/tray-icon.ico and b/src-tauri/icons/tray-icon.ico differ diff --git a/src-tauri/icons/tray-icon.png b/src-tauri/icons/tray-icon.png index 5108f89..be2533a 100644 Binary files a/src-tauri/icons/tray-icon.png and b/src-tauri/icons/tray-icon.png differ diff --git a/src-tauri/icons/win-tray-icon-activated.png b/src-tauri/icons/win-tray-icon-activated.png index c88f60e..5227561 100644 Binary files a/src-tauri/icons/win-tray-icon-activated.png and b/src-tauri/icons/win-tray-icon-activated.png differ diff --git a/src-tauri/icons/win-tray-icon.png b/src-tauri/icons/win-tray-icon.png index cab1870..29616c8 100644 Binary files a/src-tauri/icons/win-tray-icon.png and b/src-tauri/icons/win-tray-icon.png differ diff --git a/src-tauri/src/config/verge.rs b/src-tauri/src/config/verge.rs index 961280e..f0c1969 100644 --- a/src-tauri/src/config/verge.rs +++ b/src-tauri/src/config/verge.rs @@ -23,6 +23,9 @@ pub struct IVerge { /// maybe be able to set the alpha pub theme_blur: Option, + /// tray click event + pub tray_event: Option, + /// enable traffic graph default is true pub traffic_graph: Option, @@ -166,6 +169,7 @@ impl IVerge { patch!(language); patch!(theme_mode); patch!(theme_blur); + patch!(tray_event); patch!(traffic_graph); patch!(enable_memory_usage); diff --git a/src-tauri/src/core/tray.rs b/src-tauri/src/core/tray.rs index 01a5045..af3bbc2 100644 --- a/src-tauri/src/core/tray.rs +++ b/src-tauri/src/core/tray.rs @@ -107,6 +107,20 @@ impl Tray { } pub fn update_part(app_handle: &AppHandle) -> Result<()> { + let zh = { Config::verge().latest().language == Some("zh".into()) }; + + let version = app_handle.package_info().version.to_string(); + + macro_rules! t { + ($en: expr, $zh: expr) => { + if zh { + $zh + } else { + $en + } + }; + } + let mode = { Config::clash() .latest() @@ -143,11 +157,39 @@ impl Tray { let _ = tray.get_item("system_proxy").set_selected(*system_proxy); let _ = tray.get_item("tun_mode").set_selected(*tun_mode); + let switch_map = { + let mut map = std::collections::HashMap::new(); + map.insert(true, "on"); + map.insert(false, "off"); + map + }; + + #[cfg(not(target_os = "linux"))] + let _ = tray.set_tooltip(&format!( + "Clash Verge {version}\n{}: {}\n{}: {}", + t!("System Proxy", "系统代理"), + switch_map[system_proxy], + t!("TUN Mode", "Tun 模式"), + switch_map[tun_mode] + )); + Ok(()) } + pub fn on_left_click(app_handle: &AppHandle) { + let tray_event = { Config::verge().latest().tray_event.clone() }; + let tray_event = tray_event.unwrap_or("main_window".into()); + match tray_event.as_str() { + "system_proxy" => feat::toggle_system_proxy(), + "tun_mode" => feat::toggle_tun_mode(), + _ => resolve::create_window(app_handle), + } + } + pub fn on_system_tray_event(app_handle: &AppHandle, event: SystemTrayEvent) { match event { + #[cfg(not(target_os = "linux"))] + SystemTrayEvent::LeftClick { .. } => Tray::on_left_click(app_handle), SystemTrayEvent::MenuItemClick { id, .. } => match id.as_str() { mode @ ("rule_mode" | "global_mode" | "direct_mode" | "script_mode") => { let mode = &mode[0..mode.len() - 5]; @@ -177,10 +219,6 @@ impl Tray { } _ => {} }, - #[cfg(target_os = "windows")] - SystemTrayEvent::LeftClick { .. } => { - resolve::create_window(app_handle); - } _ => {} } } diff --git a/src-tauri/src/utils/init.rs b/src-tauri/src/utils/init.rs index d9f44f3..551b193 100644 --- a/src-tauri/src/utils/init.rs +++ b/src-tauri/src/utils/init.rs @@ -1,7 +1,7 @@ use crate::config::*; use crate::utils::{dirs, help}; use anyhow::Result; -use chrono::{DateTime, Local}; +use chrono::{Local, TimeZone}; use log::LevelFilter; use log4rs::append::console::ConsoleAppender; use log4rs::append::file::FileAppender; @@ -116,7 +116,7 @@ pub fn delete_log() -> Result<()> { if file_name.ends_with(".log") { let now = Local::now(); let created_time = parse_time_str(&file_name[0..file_name.len() - 4])?; - let file_time = DateTime::::from_local(created_time, now.offset().clone()); + let file_time = Local.from_local_datetime(&created_time).single().ok_or(anyhow::anyhow!("invalid local datetime"))?; let duration = now.signed_duration_since(file_time); if duration.num_days() > day { diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 3fb12bd..252d147 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "package": { "productName": "Clash Verge", - "version": "1.4.0" + "version": "1.4.1" }, "build": { "distDir": "../dist", diff --git a/src/assets/image/logo-box.png b/src/assets/image/logo-box.png index 41d4486..fe64a1f 100644 Binary files a/src/assets/image/logo-box.png and b/src/assets/image/logo-box.png differ diff --git a/src/assets/image/logo.ico b/src/assets/image/logo.ico index a471471..e406a78 100644 Binary files a/src/assets/image/logo.ico and b/src/assets/image/logo.ico differ diff --git a/src/assets/image/logo.png b/src/assets/image/logo.png index 679d795..c384c7c 100644 Binary files a/src/assets/image/logo.png and b/src/assets/image/logo.png differ diff --git a/src/assets/image/logo.svg b/src/assets/image/logo.svg index a2fbc10..750fb40 100644 --- a/src/assets/image/logo.svg +++ b/src/assets/image/logo.svg @@ -1,36 +1,18 @@ - - - + - + + + + + - - \ No newline at end of file + diff --git a/src/assets/styles/layout.scss b/src/assets/styles/layout.scss index c923c7a..168b2f0 100644 --- a/src/assets/styles/layout.scss +++ b/src/assets/styles/layout.scss @@ -5,7 +5,7 @@ overflow: hidden; &__left { - flex: 1 0 25%; + flex: 1 0 15%; display: flex; height: 100%; max-width: 225px; @@ -91,7 +91,7 @@ top: 0; left: 0; right: 2px; - bottom: 10px; + bottom: 0px; } } } diff --git a/src/assets/styles/page.scss b/src/assets/styles/page.scss index d31d9a8..a779e8c 100644 --- a/src/assets/styles/page.scss +++ b/src/assets/styles/page.scss @@ -6,43 +6,36 @@ > header { flex: 0 0 58px; - width: 95%; + width: 100%; // max-width: 850px; margin: 0 auto; - padding-right: 4px; + padding-right: 8px; box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; } - > section { - position: relative; - flex: 1 1 100%; - width: 100%; + .base-container { height: 100%; - overflow: auto; - padding: 8px 0; - box-sizing: border-box; - scrollbar-gutter: stable; - // background-color: var(--background-color); + overflow: hidden; + border-radius: var(--border-radius); - .base-content { - width: 95%; - // max-width: 850px; - margin: 0 auto; - animation: baseContentIn 0.3s normal 1 forwards; + > section { + position: relative; + flex: 1 1 100%; + width: 100%; + height: 100%; + overflow: auto; + padding: 5px 5px; + box-sizing: border-box; + scrollbar-gutter: stable; + background-color: var(--background-color); - @keyframes baseContentIn { - 0% { - opacity: 0; - transform: translateY(50%) scale(0.9); - } - - 100% { - opacity: 1; - transform: translateY(0) scale(1); - } + .base-content { + width: 100%; + // max-width: 850px; + margin: 0 auto; } } } diff --git a/src/components/base/base-page.tsx b/src/components/base/base-page.tsx index 869731a..2de528e 100644 --- a/src/components/base/base-page.tsx +++ b/src/components/base/base-page.tsx @@ -23,11 +23,13 @@ export const BasePage: React.FC = (props) => { {header} -
-
- {children} -
-
+
+
+
+ {children} +
+
+
); diff --git a/src/components/layout/layout-item.tsx b/src/components/layout/layout-item.tsx index 5a33da2..ae505e6 100644 --- a/src/components/layout/layout-item.tsx +++ b/src/components/layout/layout-item.tsx @@ -10,20 +10,24 @@ export const LayoutItem = (props: LinkProps) => { const navigate = useNavigate(); return ( - + { - const bgcolor = + /* const bgcolor = mode === "light" ? alpha(primary.main, 0.15) - : alpha(primary.main, 0.35); + : alpha(primary.main, 0.35); */ + const bgcolor = mode === "light" ? "#ffffff" : "#0E1621"; const color = mode === "light" ? primary.main : primary.light; return { diff --git a/src/components/layout/use-custom-theme.ts b/src/components/layout/use-custom-theme.ts index 312215e..0e0d69e 100644 --- a/src/components/layout/use-custom-theme.ts +++ b/src/components/layout/use-custom-theme.ts @@ -84,7 +84,7 @@ export const useCustomTheme = () => { } // css - const backgroundColor = mode === "light" ? "#ffffff" : "#121212"; + const backgroundColor = mode === "light" ? "#ffffff" : "#0E1621"; const selectColor = mode === "light" ? "#f5f5f5" : "#d5d5d5"; const scrollColor = mode === "light" ? "#90939980" : "#54545480"; diff --git a/src/components/profile/editor-viewer.tsx b/src/components/profile/editor-viewer.tsx index e5f4478..0856227 100644 --- a/src/components/profile/editor-viewer.tsx +++ b/src/components/profile/editor-viewer.tsx @@ -78,7 +78,7 @@ export const EditorViewer = (props: Props) => { {t("Edit File")} -
+
diff --git a/src/components/proxy/use-render-list.ts b/src/components/proxy/use-render-list.ts index 9f8bc0a..e87be89 100644 --- a/src/components/proxy/use-render-list.ts +++ b/src/components/proxy/use-render-list.ts @@ -35,9 +35,9 @@ export const useRenderList = (mode: string) => { // 自适应 if (col >= 6 || col <= 0) { - if (width > 1450) col = 5; - else if (width > 1024) col = 4; - else if (width > 900) col = 3; + if (width > 1450) col = 4; + else if (width > 1024) col = 3; + else if (width > 900) col = 2; else if (width >= 600) col = 2; else col = 1; } diff --git a/src/components/setting/mods/clash-core-viewer.tsx b/src/components/setting/mods/clash-core-viewer.tsx index f043684..fe827fd 100644 --- a/src/components/setting/mods/clash-core-viewer.tsx +++ b/src/components/setting/mods/clash-core-viewer.tsx @@ -18,10 +18,11 @@ import { closeAllConnections } from "@/services/api"; import { grantPermission } from "@/services/cmds"; import getSystem from "@/utils/get-system"; -const VALID_CORE = [ +/* const VALID_CORE = [ { name: "Clash", core: "clash" }, { name: "Clash Meta", core: "clash-meta" }, -]; +]; */ +const VALID_CORE = [{ name: "Clash Meta", core: "clash-meta" }]; const OS = getSystem(); @@ -91,7 +92,7 @@ export const ClashCoreViewer = forwardRef((props, ref) => { contentSx={{ pb: 0, width: 320, - height: 200, + height: 90, overflowY: "auto", userSelect: "text", marginTop: "-8px", @@ -111,7 +112,7 @@ export const ClashCoreViewer = forwardRef((props, ref) => { {(OS === "macos" || OS === "linux") && ( - ((props, ref) => { }} > - + */ + )} ))} diff --git a/src/components/setting/setting-verge.tsx b/src/components/setting/setting-verge.tsx index d54094d..b0507f3 100644 --- a/src/components/setting/setting-verge.tsx +++ b/src/components/setting/setting-verge.tsx @@ -29,8 +29,7 @@ const SettingVerge = ({ onError }: Props) => { const { t } = useTranslation(); const { verge, patchVerge, mutateVerge } = useVerge(); - const { theme_mode, language } = verge ?? {}; - + const { theme_mode, language, tray_event } = verge ?? {}; const configRef = useRef(null); const hotkeyRef = useRef(null); const miscRef = useRef(null); @@ -91,6 +90,24 @@ const SettingVerge = ({ onError }: Props) => { + {OS !== "linux" && ( + + e.target.value} + onChange={(e) => onChangeData({ tray_event: e })} + onGuard={(e) => patchVerge({ tray_event: e })} + > + + + + )} + { } > - + { - + ); }; diff --git a/src/pages/logs.tsx b/src/pages/logs.tsx index b45dbd4..8b7c0f2 100644 --- a/src/pages/logs.tsx +++ b/src/pages/logs.tsx @@ -64,7 +64,7 @@ const LogPage = () => { } > - { )} - + ); }; diff --git a/src/pages/profiles.tsx b/src/pages/profiles.tsx index 80922d0..be04f38 100644 --- a/src/pages/profiles.tsx +++ b/src/pages/profiles.tsx @@ -295,7 +295,7 @@ const ProfilePage = () => { - + {regularItems.map((item) => ( { {enhanceItems.length > 0 && ( - + {enhanceItems.map((item) => ( { } > - - + ); }; diff --git a/src/pages/rules.tsx b/src/pages/rules.tsx index 9df099f..dd7ba29 100644 --- a/src/pages/rules.tsx +++ b/src/pages/rules.tsx @@ -19,7 +19,7 @@ const RulesPage = () => { return ( - + { )} - + ); }; diff --git a/src/pages/settings.tsx b/src/pages/settings.tsx index 9cf914a..9b97944 100644 --- a/src/pages/settings.tsx +++ b/src/pages/settings.tsx @@ -1,4 +1,4 @@ -import { Grid, IconButton, Paper } from "@mui/material"; +import { Box, Grid, IconButton, Paper } from "@mui/material"; import { useLockFn } from "ahooks"; import { useTranslation } from "react-i18next"; import { BasePage, Notice } from "@/components/base"; @@ -33,19 +33,19 @@ const SettingPage = () => { } > - + - + - - + + - + - + - + diff --git a/src/services/types.d.ts b/src/services/types.d.ts index 3fe2175..49429f7 100644 --- a/src/services/types.d.ts +++ b/src/services/types.d.ts @@ -155,6 +155,7 @@ interface IProfilesConfig { interface IVergeConfig { app_log_level?: "trace" | "debug" | "info" | "warn" | "error" | string; language?: string; + tray_event?: "main_window" | "system_proxy" | "tun_mode" | string; clash_core?: string; theme_mode?: "light" | "dark" | "system"; theme_blur?: boolean;