mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-08 02:52:07 +08:00
feat: integrate tauri-plugin-clipboard-manager and add system info commands (#5593)
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
use super::{IClashTemp, IProfiles, IVerge};
|
||||
use crate::{
|
||||
cmd,
|
||||
config::{PrfItem, profiles_append_item_safe},
|
||||
constants::{files, timing},
|
||||
core::{CoreManager, handle, service, tray, validate::CoreConfigValidator},
|
||||
core::{
|
||||
CoreManager,
|
||||
handle::{self, Handle},
|
||||
service, tray,
|
||||
validate::CoreConfigValidator,
|
||||
},
|
||||
enhance,
|
||||
utils::{dirs, help},
|
||||
};
|
||||
@@ -14,6 +18,7 @@ use clash_verge_logging::{Type, logging, logging_error};
|
||||
use clash_verge_types::runtime::IRuntime;
|
||||
use smartstring::alias::String;
|
||||
use std::path::PathBuf;
|
||||
use tauri_plugin_clash_verge_sysinfo::is_current_app_handle_admin;
|
||||
use tokio::sync::OnceCell;
|
||||
use tokio::time::sleep;
|
||||
|
||||
@@ -60,7 +65,10 @@ impl Config {
|
||||
Self::ensure_default_profile_items().await?;
|
||||
|
||||
// init Tun mode
|
||||
if !cmd::system::is_admin() && service::is_service_available().await.is_err() {
|
||||
let handle = Handle::app_handle();
|
||||
let is_admin = is_current_app_handle_admin(handle);
|
||||
let is_service_available = service::is_service_available().await.is_ok();
|
||||
if !is_admin && !is_service_available {
|
||||
let verge = Self::verge().await;
|
||||
verge.edit_draft(|d| {
|
||||
d.enable_tun_mode = Some(false);
|
||||
|
||||
Reference in New Issue
Block a user