update clashmeta core, Imporve UI, merge PR, reset icons, fix CI

This commit is contained in:
wonfen 2023-11-28 07:49:44 +08:00
parent 9d4942723c
commit bda87167a3
57 changed files with 298 additions and 117 deletions

View File

@ -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

View File

@ -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": {

View File

@ -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:
{

View File

@ -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);

2
src-tauri/Cargo.lock generated
View File

@ -547,7 +547,7 @@ dependencies = [
[[package]]
name = "clash-verge"
version = "1.4.0"
version = "1.4.1"
dependencies = [
"anyhow",
"auto-launch",

View File

@ -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"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -23,6 +23,9 @@ pub struct IVerge {
/// maybe be able to set the alpha
pub theme_blur: Option<bool>,
/// tray click event
pub tray_event: Option<String>,
/// enable traffic graph default is true
pub traffic_graph: Option<bool>,
@ -166,6 +169,7 @@ impl IVerge {
patch!(language);
patch!(theme_mode);
patch!(theme_blur);
patch!(tray_event);
patch!(traffic_graph);
patch!(enable_memory_usage);

View File

@ -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);
}
_ => {}
}
}

View File

@ -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::<Local>::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 {

View File

@ -1,7 +1,7 @@
{
"package": {
"productName": "Clash Verge",
"version": "1.4.0"
"version": "1.4.1"
},
"build": {
"distDir": "../dist",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 227 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -1,36 +1,18 @@
<!--
Copyright (C) 2022 The Project Verge
SPDX-License-Identifier: Apache-2.0
thanks: @ReallySnow
-->
<svg width="420px" height="490px" viewBox="0 0 420 490" version="1.1"
xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg id="svg" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="400"
height="400" viewBox="0, 0, 400,400">
<defs>
<style><![CDATA[
#element {
fill: #000000;
}
]]></style>
<linearGradient id="Gradient2" x1="0" x2="-0.1" y1="0" y2="1">
<stop offset="0%" stop-color="#5b5c9d" />
<stop offset="80%" stop-color="rgb(63, 64, 109)" />
<stop offset="100%" stop-color="rgb(63, 64, 109)" />
</linearGradient>
</defs>
<g id="Verge_logo" fill-rule="nonzero">
<path
d="M349.980734,470.820835 C362.906597,470.820835 375.380055,471.040616 387.808272,470.736801 C394.678368,470.562269 398.898662,465.526692 400.333433,457.394784 C402.20122,446.832354 400.417451,436.780592 395.809381,427.284747 C390.832924,417.03906 385.255414,407.090725 380.233716,396.903216 C360.528238,356.825451 356.463054,315.532425 371.896535,273.134028 C376.646789,260.076434 384.111475,248.479739 394.781775,239.255389 C400.869857,233.993566 405.684741,233.870747 409.911498,238.718864 C414.138255,243.56698 413.285148,248.415097 407.500824,253.663991 C390.535629,269.081003 384.285974,289.34613 382.230762,311.27901 C379.516331,340.367711 385.669042,367.633519 399.499715,393.373787 C407.100123,407.523823 416.070671,421.169656 418.88851,437.433471 C420.614112,447.317165 420.484854,457.129754 417.402035,466.787202 C412.613003,481.764651 401.244707,490.012913 385.513931,490 C273.567341,489.896558 161.622905,489.814679 49.6806226,489.754347 C42.5713979,489.754347 35.4621733,489.993521 28.605003,487.73753 C11.4136053,482.081394 -0.0322464095,467.259085 0,448.855634 C0.103475152,390.930336 0.374918274,333.011502 3.10227536,275.124988 C4.89250738,237.057576 7.30964376,199.054805 11.2067914,161.148996 C16.3771366,110.612228 23.6608604,60.405131 34.5315112,10.7604159 C35.0024707,8.67513302 35.7547542,6.66358964 36.7676855,4.78107191 C38.5191399,1.50374502 41.1689418,-0.513071536 45.1694964,0.113951558 C49.170051,0.740974653 49.3768648,4.11526388 49.9326769,6.9530282 C53.9913979,27.6706469 60.3056819,47.7612426 66.8590945,67.7742684 C68.9853989,74.238424 70.1875042,82.4543658 74.7891114,86.326395 C79.26146,90.0949977 87.6051045,87.3541957 94.2425352,87.3735882 C154.302557,87.5028713 214.369043,86.8176708 274.422602,88.3755323 C279.256875,88.4983513 281.615845,87.0827012 283.509484,82.6353621 C293.203881,59.8750702 301.967616,36.8044988 308.495177,12.925908 C309.309506,9.94593225 309.942874,6.778496 313.710763,6.46175237 C317.129653,6.17732953 319.346439,8.49796139 320.858765,11.1547293 C321.981523,13.2263513 322.777248,15.4591645 323.217735,17.7740247 C332.832735,64.3247661 340.022746,111.343788 344.758685,158.640904 C354.220417,251.724745 355.745669,345.112401 356.152834,438.538842 C356.152834,444.123872 356.217463,449.695975 355.370819,455.274541 C354.569415,460.646254 352.048872,465.38448 349.980734,470.820835 Z"
id="element" fill-rule="evenodd"></path>
<path
d="M314.373914,51.8580359 C319.16418,79.1645649 322.474053,106.509891 325.189183,133.926344 C335.474355,237.585109 337,341.580114 337,445.633314 C337,462.193111 328.052999,470.974135 311.283837,470.980602 C222.356854,471.006466 133.429871,471.006466 44.5028879,470.980602 C27.8242301,470.980602 18.9741981,462.050856 19,445.491059 C19.0776317,397.460537 19.1422776,349.423548 20.816608,301.425356 C22.7559868,246.3726 25.665055,191.384506 31.4637977,136.538667 C34.2500385,110.221458 37.8831415,84.0335719 41.044329,57.7745583 C41.348165,55.2398296 42.0398768,52.7503639 42.8026991,49 C47.5541772,66.3034032 53.702008,81.848015 58.6926762,97.7676631 C60.6902363,104.123883 64.0001095,106.632747 70.7620769,106.632747 C141.816607,106.58964 212.868982,106.72974 283.919202,107.053047 C290.11875,107.053047 293.415694,104.679972 295.555475,99.1643504 C301.63866,83.3804912 308.652746,67.9328716 314.373914,51.8580359 Z"
id="bg" fill="#ffffff" fill-rule="evenodd"></path>
<path
d="M119.999315,204.118735 C120.083729,213.985193 112.350174,222.057169 102.850433,222 C94.0584657,221.961379 86.9547636,214.451375 87,205.249067 C87.0456702,196.148935 94.5909186,188.268541 103.493273,188.006712 C112.395627,187.744884 119.921396,195.178255 119.999315,204.118735 Z"
id="element" fill-rule="evenodd"></path>
<path
d="M236,204.861743 C236,195.671258 243.035135,188.142475 251.816026,188.001869 C261.124552,187.861264 268.993481,195.671258 269,205.104607 C269.006509,214.537955 262.179823,221.772746 253.255623,221.996436 C244.16206,222.194562 236.026056,214.103357 236,204.861743 Z"
id="element" fill-rule="evenodd"></path>
<path
d="M190.493614,267.920884 C185.555364,268.142338 181.468093,262.430145 177.097162,262.137045 C172.945422,261.850458 168.716321,267.914371 162.875519,267.999044 C153.295574,268.096744 144.921179,260.691085 144.089542,251.064378 C143.851011,248.296212 143.844564,245.541072 147.312943,245.059085 C150.362279,244.622692 151.0263,246.902358 151.638746,249.481638 C153.327808,256.646305 157.286143,260.411011 162.701456,259.935538 C168.890385,259.394931 172.371657,255.649765 173.087252,249.468612 C173.383805,247.045652 174.234782,245.104678 176.819949,245.026518 C179.869286,244.935332 180.481732,247.208485 180.855647,249.813818 C181.751752,255.988458 185.426428,259.870405 191.570229,259.889945 C197.71403,259.909485 201.433834,255.981945 202.342833,249.872438 C202.774769,246.954465 203.516151,244.433805 206.907168,245.111192 C210.130569,245.762525 210.195037,248.634905 209.872697,251.383532 C208.750953,260.769245 200.621538,268.044638 190.493614,267.920884 Z"
id="element" fill-rule="evenodd"></path>
<g id="svgg">
<path id="path0"
d="M118.124 39.858 C 116.645 40.182,114.562 42.930,113.283 46.247 C 111.908 49.812,110.887 54.542,107.205 74.400 C 106.736 76.930,105.926 81.160,105.404 83.800 C 104.527 88.237,103.654 92.889,102.177 101.000 C 101.856 102.760,101.413 105.100,101.192 106.200 C 100.754 108.375,100.784 108.199,98.436 122.200 C 96.675 132.702,95.947 137.215,94.984 143.600 C 94.636 145.910,94.098 149.420,93.789 151.400 C 92.649 158.697,91.961 164.413,92.180 164.768 C 92.304 164.968,92.223 165.192,92.000 165.266 C 91.777 165.340,96.852 165.347,103.277 165.282 C 116.520 165.149,115.721 165.379,116.358 161.519 C 122.839 122.279,179.334 121.580,186.617 160.650 C 186.981 162.602,187.463 164.425,187.689 164.700 C 188.328 165.481,229.717 165.423,230.367 164.640 C 230.622 164.332,231.013 162.937,231.235 161.540 C 237.531 121.949,295.239 121.807,301.620 161.367 C 302.274 165.421,301.855 165.252,310.962 165.117 C 315.273 165.052,318.861 165.090,318.935 165.200 C 319.009 165.310,319.005 165.152,318.927 164.848 C 318.849 164.545,318.519 162.610,318.193 160.548 C 317.867 158.487,317.330 155.135,317.000 153.100 C 316.162 147.934,315.312 142.663,314.823 139.600 C 314.595 138.170,314.226 136.010,314.004 134.800 C 313.781 133.590,312.423 125.400,310.985 116.600 C 304.278 75.545,304.008 74.156,298.145 50.400 C 295.961 41.553,294.621 39.584,290.800 39.611 C 287.927 39.631,283.053 43.395,279.420 48.400 C 277.509 51.032,261.566 79.109,256.960 87.953 C 253.991 93.654,253.647 93.789,245.600 92.402 C 218.757 87.774,194.454 87.780,170.478 92.420 C 162.868 93.893,163.987 94.596,157.579 84.306 C 133.879 46.247,126.566 38.009,118.124 39.858 M147.277 134.807 C 123.365 138.118,111.083 165.918,124.948 185.349 C 140.543 207.202,173.704 202.274,182.466 176.800 C 190.000 154.900,170.471 131.596,147.277 134.807 M262.051 134.810 C 235.780 138.440,224.730 170.720,243.356 189.422 C 264.398 210.548,299.874 195.275,298.689 165.600 C 297.927 146.523,280.892 132.207,262.051 134.810 M157.600 153.840 C 163.092 156.341,166.343 161.914,165.902 168.074 C 164.875 182.425,145.082 186.221,138.715 173.287 C 132.759 161.189,145.324 148.250,157.600 153.840 M273.193 153.597 C 279.788 156.926,283.287 165.159,280.844 171.600 C 275.229 186.406,253.594 183.910,252.135 168.287 C 251.125 157.467,263.609 148.758,273.193 153.597 M91.200 168.809 C 91.200 169.522,90.939 171.836,90.621 173.952 C 89.933 178.523,87.567 196.170,85.788 210.000 C 85.462 212.530,85.012 215.860,84.786 217.400 C 84.561 218.940,84.191 221.820,83.964 223.800 C 83.737 225.780,83.288 229.560,82.965 232.200 C 81.886 241.026,80.172 255.664,79.404 262.600 C 78.867 267.450,78.532 270.381,76.987 283.800 C 76.251 290.187,75.405 297.881,74.568 305.800 C 74.220 309.100,73.789 313.150,73.613 314.800 C 73.436 316.450,73.063 320.230,72.784 323.200 C 72.504 326.170,72.169 328.723,72.038 328.874 C 71.701 329.262,59.638 327.033,54.028 325.546 C 34.668 320.412,26.096 301.951,35.625 285.911 C 38.026 281.869,41.515 278.587,49.795 272.581 C 58.081 266.570,59.262 265.247,59.510 261.702 C 59.969 255.136,50.677 252.070,40.551 255.447 C -6.127 271.014,-3.894 337.227,43.806 351.951 C 50.541 354.030,58.050 355.239,67.760 355.807 C 72.410 356.079,75.202 356.542,82.181 358.199 C 88.822 359.777,100.215 360.425,156.000 362.398 C 170.725 362.918,255.192 362.921,267.760 362.401 C 273.062 362.182,281.900 361.820,287.400 361.597 C 302.851 360.972,326.558 359.339,333.200 358.444 C 343.055 357.116,343.889 354.966,341.839 336.200 C 341.502 333.120,340.948 327.900,340.607 324.600 C 340.266 321.300,339.709 315.990,339.370 312.800 C 339.030 309.610,338.499 304.570,338.189 301.600 C 337.022 290.393,335.650 278.160,334.622 269.800 C 333.105 257.460,332.638 254.027,330.408 238.800 C 329.716 234.070,328.983 229.030,328.781 227.600 C 328.579 226.170,328.231 223.920,328.008 222.600 C 327.785 221.280,326.695 214.260,325.587 207.000 C 324.478 199.740,323.124 191.010,322.578 187.600 C 322.032 184.190,321.325 179.780,321.007 177.800 C 320.689 175.820,320.203 172.711,319.925 170.892 C 319.508 168.155,319.315 167.635,318.810 167.885 C 318.475 168.051,314.780 168.279,310.600 168.393 C 301.870 168.631,302.159 168.535,301.810 171.300 C 299.468 189.825,283.036 203.371,264.230 202.279 C 247.552 201.310,233.532 188.465,231.203 172.020 C 230.651 168.125,232.337 168.400,209.000 168.400 C 185.703 168.400,187.432 168.114,186.814 172.064 C 180.639 211.474,123.556 212.329,116.559 173.117 C 115.684 168.218,116.787 168.629,103.881 168.400 C 97.676 168.290,92.285 168.046,91.900 167.857 C 91.307 167.567,91.200 167.712,91.200 168.809 M211.015 197.632 C 214.247 200.942,215.394 201.357,220.447 201.050 C 225.236 200.759,225.846 201.071,224.310 203.023 C 221.899 206.089,216.333 205.843,210.779 202.425 C 208.312 200.907,207.846 200.906,205.600 202.405 C 200.180 206.022,193.561 206.136,191.600 202.647 C 190.824 201.267,191.555 200.665,193.600 201.001 C 199.643 201.993,201.561 201.450,204.900 197.805 C 207.534 194.929,208.352 194.906,211.015 197.632 "
stroke="none" fill="url(#Gradient2)" fill-rule="evenodd"></path>
<path id="path1"
d="M148.000 131.622 C 132.020 133.140,119.114 145.293,116.377 161.400 C 115.675 165.535,116.697 165.239,103.579 165.112 C 97.252 165.050,92.159 165.135,92.261 165.300 C 92.364 165.465,92.279 165.600,92.074 165.600 C 91.391 165.600,91.684 167.617,92.424 168.013 C 92.839 168.235,97.730 168.400,103.897 168.400 C 116.551 168.400,115.666 168.070,116.562 173.117 C 123.522 212.326,180.639 211.470,186.814 172.064 C 187.432 168.114,185.703 168.400,209.000 168.400 C 232.337 168.400,230.651 168.125,231.203 172.020 C 233.532 188.465,247.552 201.310,264.230 202.279 C 283.039 203.371,299.468 189.826,301.811 171.294 C 302.169 168.458,302.345 168.400,310.600 168.400 C 318.988 168.400,319.609 168.159,318.852 165.200 C 318.824 165.090,315.273 165.052,310.961 165.117 C 301.855 165.252,302.274 165.421,301.620 161.367 C 295.239 121.807,237.531 121.949,231.235 161.540 C 231.013 162.937,230.622 164.332,230.367 164.640 C 229.717 165.423,188.328 165.481,187.689 164.700 C 187.463 164.425,186.981 162.602,186.617 160.650 C 183.194 142.288,166.648 129.850,148.000 131.622 M159.886 135.622 C 183.880 141.759,192.035 172.033,174.435 189.636 C 156.404 207.671,125.892 198.962,119.944 174.084 C 114.368 150.761,136.343 129.601,159.886 135.622 M274.658 135.615 C 299.082 141.861,307.061 172.817,288.734 190.222 C 267.975 209.936,234.188 195.420,234.219 166.800 C 234.241 145.502,253.935 130.315,274.658 135.615 M148.542 152.793 C 139.499 154.706,134.598 164.925,138.715 173.287 C 145.082 186.221,164.875 182.425,165.902 168.074 C 166.591 158.446,157.916 150.811,148.542 152.793 M262.091 153.188 C 253.922 156.127,249.883 165.408,253.408 173.139 C 257.835 182.850,271.593 184.491,278.201 176.097 C 287.389 164.426,275.974 148.192,262.091 153.188 M204.900 197.805 C 201.561 201.450,199.643 201.993,193.600 201.001 C 191.555 200.665,190.824 201.267,191.600 202.647 C 193.561 206.136,200.180 206.022,205.600 202.405 C 207.846 200.906,208.312 200.907,210.779 202.425 C 216.333 205.843,221.899 206.089,224.310 203.023 C 225.846 201.071,225.236 200.759,220.447 201.050 C 215.394 201.357,214.247 200.942,211.015 197.632 C 208.352 194.906,207.534 194.929,204.900 197.805 "
stroke="none" fill="#ffffff" fill-rule="evenodd"></path>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -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;
}
}
}

View File

@ -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;
}
.base-container {
height: 100%;
overflow: hidden;
border-radius: var(--border-radius);
> section {
position: relative;
flex: 1 1 100%;
width: 100%;
height: 100%;
overflow: auto;
padding: 8px 0;
padding: 5px 5px;
box-sizing: border-box;
scrollbar-gutter: stable;
// background-color: var(--background-color);
background-color: var(--background-color);
.base-content {
width: 95%;
width: 100%;
// max-width: 850px;
margin: 0 auto;
animation: baseContentIn 0.3s normal 1 forwards;
@keyframes baseContentIn {
0% {
opacity: 0;
transform: translateY(50%) scale(0.9);
}
100% {
opacity: 1;
transform: translateY(0) scale(1);
}
}
}
}

View File

@ -23,12 +23,14 @@ export const BasePage: React.FC<Props> = (props) => {
{header}
</header>
<div className="base-container">
<section>
<div className="base-content" style={contentStyle} data-windrag>
{children}
</div>
</section>
</div>
</div>
</BaseErrorBoundary>
);
};

View File

@ -10,20 +10,24 @@ export const LayoutItem = (props: LinkProps) => {
const navigate = useNavigate();
return (
<ListItem sx={{ py: 0.5, maxWidth: 250, mx: "auto" }}>
<ListItem
sx={{ py: 0.5, maxWidth: 250, mx: "auto", padding: "4px 0px 4px 2px" }}
>
<ListItemButton
selected={!!match}
sx={[
{
borderRadius: 2,
borderTopLeftRadius: 18,
borderBottomLeftRadius: 18,
textAlign: "center",
"& .MuiListItemText-primary": { color: "text.secondary" },
},
({ palette: { mode, primary } }) => {
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 {

View File

@ -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";

View File

@ -78,7 +78,7 @@ export const EditorViewer = (props: Props) => {
<DialogTitle>{t("Edit File")}</DialogTitle>
<DialogContent sx={{ width: "95%", pb: 1, userSelect: "text" }}>
<div style={{ width: "100%", height: "420px" }} ref={editorRef} />
<div style={{ width: "100%", height: "500px" }} ref={editorRef} />
</DialogContent>
<DialogActions>

View File

@ -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;
}

View File

@ -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<DialogRef>((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<DialogRef>((props, ref) => {
<ListItemText primary={each.name} secondary={`/${each.core}`} />
{(OS === "macos" || OS === "linux") && (
<IconButton
/* <IconButton
color="inherit"
size="small"
edge="end"
@ -122,7 +123,19 @@ export const ClashCoreViewer = forwardRef<DialogRef>((props, ref) => {
}}
>
<Lock fontSize="inherit" />
</IconButton>
</IconButton> */
<Button
variant="outlined"
size="small"
title={t("Tun mode requires")}
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
onGrant(each.core);
}}
>
{t("Grant")}
</Button>
)}
</ListItemButton>
))}

View File

@ -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<DialogRef>(null);
const hotkeyRef = useRef<DialogRef>(null);
const miscRef = useRef<DialogRef>(null);
@ -91,6 +90,24 @@ const SettingVerge = ({ onError }: Props) => {
</GuardState>
</SettingItem>
{OS !== "linux" && (
<SettingItem label={t("Tray Click Event")}>
<GuardState
value={tray_event ?? "main_window"}
onCatch={onError}
onFormat={(e: any) => e.target.value}
onChange={(e) => onChangeData({ tray_event: e })}
onGuard={(e) => patchVerge({ tray_event: e })}
>
<Select size="small" sx={{ width: 140, "> div": { py: "7.5px" } }}>
<MenuItem value="main_window">{t("Show Main Window")}</MenuItem>
<MenuItem value="system_proxy">{t("System Proxy")}</MenuItem>
<MenuItem value="tun_mode">{t("Tun Mode")}</MenuItem>
</Select>
</GuardState>
</SettingItem>
)}
<SettingItem label={t("Theme Setting")}>
<IconButton
color="inherit"

View File

@ -69,6 +69,8 @@
"Mixed Port": "Mixed Port",
"External": "External",
"Clash Core": "Clash Core",
"Grant": "Grant",
"Tun mode requires": "Tun mode requires",
"Tun Mode": "Tun Mode",
"Service Mode": "Service Mode",
"Auto Launch": "Auto Launch",
@ -85,6 +87,8 @@
"Current System Proxy": "Current System Proxy",
"Theme Mode": "Theme Mode",
"Theme Blur": "Theme Blur",
"Tray Click Event": "Tray Click Event",
"Show Main Window": "Show Main Window",
"Theme Setting": "Theme Setting",
"Layout Setting": "Layout Setting",
"Miscellaneous": "Miscellaneous",

View File

@ -78,6 +78,8 @@
"Current System Proxy": "Текущий системный прокси",
"Theme Mode": "Режим темы",
"Theme Blur": "Размытие темы",
"Tray Click Event": "Событие щелчка в лотке",
"Show Main Window": "Показать главное окно",
"Theme Setting": "Настройка темы",
"Hotkey Setting": "Настройка клавиатурных сокращений",
"Traffic Graph": "График трафика",

View File

@ -69,6 +69,8 @@
"Mixed Port": "端口设置",
"External": "外部控制",
"Clash Core": "Clash 内核",
"Grant": "授权",
"Tun mode requires": "如需启用TUN模式需要授权",
"Tun Mode": "Tun 模式",
"Service Mode": "服务模式",
"Auto Launch": "开机自启",
@ -85,6 +87,8 @@
"Bypass": "当前绕过:",
"Theme Mode": "主题模式",
"Theme Blur": "背景模糊",
"Tray Click Event": "托盘点击事件",
"Show Main Window": "显示主窗口",
"Theme Setting": "主题设置",
"Layout Setting": "界面设置",
"Miscellaneous": "杂项设置",
@ -101,7 +105,7 @@
"theme.dark": "深色",
"theme.system": "系统",
"Clash Field": "Clash 字段",
"Runtime Config": "运行订阅",
"Runtime Config": "当前配置",
"ReadOnly": "只读",
"Restart": "重启内核",

View File

@ -8,7 +8,7 @@ export const defaultTheme = {
error_color: "#d32f2f",
warning_color: "#ed6c02",
success_color: "#2e7d32",
font_family: `"Roboto", "Helvetica", "Arial", sans-serif, "twemoji mozilla"`,
font_family: `"twemoji mozilla", "Roboto", "Helvetica", "Arial", sans-serif`,
};
// dark mode

View File

@ -142,7 +142,7 @@ const ConnectionsPage = () => {
</Box>
}
>
<Paper sx={{ boxShadow: 0, height: "100%" }}>
<Box sx={{ boxShadow: 0, height: "100%" }}>
<Box
sx={{
pt: 1,
@ -210,7 +210,7 @@ const ConnectionsPage = () => {
</Box>
<ConnectionDetail ref={detailRef} />
</Paper>
</Box>
</BasePage>
);
};

View File

@ -64,7 +64,7 @@ const LogPage = () => {
</Box>
}
>
<Paper
<Box
sx={{
boxSizing: "border-box",
boxShadow: 0,
@ -121,7 +121,7 @@ const LogPage = () => {
<BaseEmpty text="No Logs" />
)}
</Box>
</Paper>
</Box>
</BasePage>
);
};

View File

@ -295,7 +295,7 @@ const ProfilePage = () => {
</Stack>
<Box sx={{ mb: 4.5 }}>
<Grid container spacing={{ xs: 2, lg: 3 }}>
<Grid container spacing={{ xs: 1, lg: 1 }}>
{regularItems.map((item) => (
<Grid item xs={12} sm={6} md={4} lg={3} key={item.file}>
<ProfileItem
@ -311,7 +311,7 @@ const ProfilePage = () => {
</Box>
{enhanceItems.length > 0 && (
<Grid container spacing={{ xs: 2, lg: 3 }}>
<Grid container spacing={{ xs: 2, lg: 2 }}>
{enhanceItems.map((item) => (
<Grid item xs={12} sm={6} md={4} lg={3} key={item.file}>
<ProfileMore

View File

@ -72,17 +72,16 @@ const ProxyPage = () => {
</Box>
}
>
<Paper
<Box
sx={{
borderRadius: 1,
boxShadow: 0,
height: "100%",
boxSizing: "border-box",
py: 1,
}}
>
<ProxyGroups mode={curMode!} />
</Paper>
</Box>
</BasePage>
);
};

View File

@ -19,7 +19,7 @@ const RulesPage = () => {
return (
<BasePage title={t("Rules")} contentStyle={{ height: "100%" }}>
<Paper sx={{ boxSizing: "border-box", boxShadow: 0, height: "100%" }}>
<Box sx={{ boxSizing: "border-box", boxShadow: 0, height: "100%" }}>
<Box
sx={{
pt: 1,
@ -57,7 +57,7 @@ const RulesPage = () => {
<BaseEmpty text="No Rules" />
)}
</Box>
</Paper>
</Box>
</BasePage>
);
};

View File

@ -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 = () => {
</IconButton>
}
>
<Grid container spacing={{ xs: 2, lg: 3 }}>
<Grid container spacing={{ xs: 1, lg: 1 }}>
<Grid item xs={12} md={6}>
<Paper sx={{ borderRadius: 1, boxShadow: 2, marginBottom: 2 }}>
<Box sx={{ borderRadius: 1, boxShadow: 2, marginBottom: 1 }}>
<SettingSystem onError={onError} />
</Paper>
<Paper sx={{ borderRadius: 1, boxShadow: 2 }}>
</Box>
<Box sx={{ borderRadius: 1, boxShadow: 2 }}>
<SettingClash onError={onError} />
</Paper>
</Box>
</Grid>
<Grid item xs={12} md={6}>
<Paper sx={{ borderRadius: 1, boxShadow: 2 }}>
<Box sx={{ borderRadius: 1, boxShadow: 2 }}>
<SettingVerge onError={onError} />
</Paper>
</Box>
</Grid>
</Grid>
</BasePage>

View File

@ -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;