mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 00:33:45 +08:00
39 lines
1.1 KiB
Rust
39 lines
1.1 KiB
Rust
use super::CmdResult;
|
|
use crate::{
|
|
core::{service, CoreManager},
|
|
logging_error,
|
|
utils::logging::Type,
|
|
};
|
|
|
|
#[tauri::command]
|
|
pub async fn install_service() -> CmdResult {
|
|
logging_error!(Type::Service, true, service::install_service().await);
|
|
logging_error!(Type::Core, true, CoreManager::global().restart_core().await);
|
|
Ok(())
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub async fn uninstall_service() -> CmdResult {
|
|
logging_error!(Type::Service, true, service::uninstall_service().await);
|
|
logging_error!(Type::Core, true, CoreManager::global().restart_core().await);
|
|
Ok(())
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub async fn reinstall_service() -> CmdResult {
|
|
logging_error!(Type::Service, true, service::reinstall_service().await);
|
|
logging_error!(Type::Core, true, CoreManager::global().restart_core().await);
|
|
Ok(())
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub async fn repair_service() -> CmdResult {
|
|
logging_error!(
|
|
Type::Service,
|
|
true,
|
|
service::force_reinstall_service().await
|
|
);
|
|
logging_error!(Type::Core, true, CoreManager::global().restart_core().await);
|
|
Ok(())
|
|
}
|