mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
2.2.4-alpha.0
This commit is contained in:
@@ -35,7 +35,7 @@ pub fn get_auto_proxy() -> CmdResult<Mapping> {
|
||||
#[tauri::command]
|
||||
pub fn get_system_hostname() -> CmdResult<String> {
|
||||
use gethostname::gethostname;
|
||||
|
||||
|
||||
// 获取系统主机名,处理可能的非UTF-8字符
|
||||
let hostname = match gethostname().into_string() {
|
||||
Ok(name) => name,
|
||||
@@ -46,7 +46,7 @@ pub fn get_system_hostname() -> CmdResult<String> {
|
||||
fallback.trim_matches('"').to_string()
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Ok(hostname)
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,10 @@ impl Sysopt {
|
||||
(
|
||||
verge.enable_system_proxy.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.proxy_guard_duration.unwrap_or(10),
|
||||
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")),
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user