mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-04 23:23:45 +08:00
2.2.4-alpha.0
This commit is contained in:
parent
d84b5456ff
commit
a7f156189c
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "clash-verge",
|
"name": "clash-verge",
|
||||||
"version": "2.2.4-alpha",
|
"version": "2.2.4-alpha.0",
|
||||||
"license": "GPL-3.0-only",
|
"license": "GPL-3.0-only",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "cross-env RUST_BACKTRACE=1 tauri dev -f verge-dev -- --profile fast-dev",
|
"dev": "cross-env RUST_BACKTRACE=1 tauri dev -f verge-dev -- --profile fast-dev",
|
||||||
|
@ -35,7 +35,7 @@ pub fn get_auto_proxy() -> CmdResult<Mapping> {
|
|||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub fn get_system_hostname() -> CmdResult<String> {
|
pub fn get_system_hostname() -> CmdResult<String> {
|
||||||
use gethostname::gethostname;
|
use gethostname::gethostname;
|
||||||
|
|
||||||
// 获取系统主机名,处理可能的非UTF-8字符
|
// 获取系统主机名,处理可能的非UTF-8字符
|
||||||
let hostname = match gethostname().into_string() {
|
let hostname = match gethostname().into_string() {
|
||||||
Ok(name) => name,
|
Ok(name) => name,
|
||||||
@ -46,7 +46,7 @@ pub fn get_system_hostname() -> CmdResult<String> {
|
|||||||
fallback.trim_matches('"').to_string()
|
fallback.trim_matches('"').to_string()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(hostname)
|
Ok(hostname)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ impl IClashTemp {
|
|||||||
.and_then(|value| match value.as_str() {
|
.and_then(|value| match value.as_str() {
|
||||||
Some(val_str) => {
|
Some(val_str) => {
|
||||||
let val_str = val_str.trim();
|
let val_str = val_str.trim();
|
||||||
|
|
||||||
if val_str.is_empty() {
|
if val_str.is_empty() {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
@ -238,7 +238,7 @@ impl IClashTemp {
|
|||||||
if value.is_empty() {
|
if value.is_empty() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
match SocketAddr::from_str(value.as_str()) {
|
match SocketAddr::from_str(value.as_str()) {
|
||||||
Ok(mut socket) => {
|
Ok(mut socket) => {
|
||||||
if socket.ip().is_unspecified() {
|
if socket.ip().is_unspecified() {
|
||||||
@ -297,10 +297,7 @@ fn test_clash_info() {
|
|||||||
get_result(8888, "127.0.0.1:8888")
|
get_result(8888, "127.0.0.1:8888")
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(get_case(8888, " :98888 "), get_result(8888, ""));
|
||||||
get_case(8888, " :98888 "),
|
|
||||||
get_result(8888, "")
|
|
||||||
);
|
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
get_case(8888, "0.0.0.0:8080 "),
|
get_case(8888, "0.0.0.0:8080 "),
|
||||||
@ -322,10 +319,7 @@ fn test_clash_info() {
|
|||||||
get_result(8888, "192.168.1.1:8080")
|
get_result(8888, "192.168.1.1:8080")
|
||||||
);
|
);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(get_case(8888, "192.168.1.1:80800"), get_result(8888, ""));
|
||||||
get_case(8888, "192.168.1.1:80800"),
|
|
||||||
get_result(8888, "")
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
|
#[derive(Default, Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
|
||||||
|
@ -82,7 +82,10 @@ impl Sysopt {
|
|||||||
(
|
(
|
||||||
verge.enable_system_proxy.unwrap_or(false),
|
verge.enable_system_proxy.unwrap_or(false),
|
||||||
verge.proxy_auto_config.unwrap_or(false),
|
verge.proxy_auto_config.unwrap_or(false),
|
||||||
verge.proxy_host.clone().unwrap_or_else(|| String::from("127.0.0.1")),
|
verge
|
||||||
|
.proxy_host
|
||||||
|
.clone()
|
||||||
|
.unwrap_or_else(|| String::from("127.0.0.1")),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -265,7 +268,10 @@ impl Sysopt {
|
|||||||
verge.enable_proxy_guard.unwrap_or(false),
|
verge.enable_proxy_guard.unwrap_or(false),
|
||||||
verge.proxy_guard_duration.unwrap_or(10),
|
verge.proxy_guard_duration.unwrap_or(10),
|
||||||
verge.proxy_auto_config.unwrap_or(false),
|
verge.proxy_auto_config.unwrap_or(false),
|
||||||
verge.proxy_host.clone().unwrap_or_else(|| String::from("127.0.0.1")),
|
verge
|
||||||
|
.proxy_host
|
||||||
|
.clone()
|
||||||
|
.unwrap_or_else(|| String::from("127.0.0.1")),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user