mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 04:43:44 +08:00
This commit is contained in:
parent
fa2e86df29
commit
26a3dbcbe1
@ -65,6 +65,7 @@ pub async fn patch_profiles_config(profiles: IProfiles) -> CmdResult {
|
|||||||
match CoreManager::global().update_config().await {
|
match CoreManager::global().update_config().await {
|
||||||
Ok(_) => {
|
Ok(_) => {
|
||||||
handle::Handle::refresh_clash();
|
handle::Handle::refresh_clash();
|
||||||
|
let _ = handle::Handle::update_systray_part();
|
||||||
Config::profiles().apply();
|
Config::profiles().apply();
|
||||||
wrap_err!(Config::profiles().data().save_file())?;
|
wrap_err!(Config::profiles().data().save_file())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -260,13 +260,25 @@ impl Tray {
|
|||||||
map.insert(false, "off");
|
map.insert(false, "off");
|
||||||
map
|
map
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let mut current_profile_name = "None".to_string();
|
||||||
|
let profiles = Config::profiles();
|
||||||
|
let profiles = profiles.latest();
|
||||||
|
if let Some(current_profile_uid) = profiles.get_current() {
|
||||||
|
let current_profile = profiles.get_item(¤t_profile_uid);
|
||||||
|
current_profile_name = match ¤t_profile.unwrap().name {
|
||||||
|
Some(profile_name) => profile_name.to_string(),
|
||||||
|
None => current_profile_name,
|
||||||
|
};
|
||||||
|
};
|
||||||
let _ = tray.set_tooltip(&format!(
|
let _ = tray.set_tooltip(&format!(
|
||||||
"Clash Verge {version}\n{}: {}\n{}: {}",
|
"Clash Verge {version}\n{}: {}\n{}: {}\n{}: {}",
|
||||||
t!("System Proxy", "系统代理"),
|
t!("System Proxy", "系统代理"),
|
||||||
switch_map[system_proxy],
|
switch_map[system_proxy],
|
||||||
t!("TUN Mode", "Tun 模式"),
|
t!("TUN Mode", "Tun 模式"),
|
||||||
switch_map[tun_mode]
|
switch_map[tun_mode],
|
||||||
|
t!("Curent Profile", "当前订阅"),
|
||||||
|
current_profile_name
|
||||||
));
|
));
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user