feat: add service uninstall functionality and improve service operation flow

This commit is contained in:
Tunglies
2025-05-13 01:56:19 +08:00
parent 6578cd8c51
commit 1ddbe7c2cc
6 changed files with 100 additions and 19 deletions

View File

@@ -65,6 +65,19 @@ pub async fn change_clash_core(clash_core: String) -> CmdResult<Option<String>>
}
}
/// 启动核心
#[tauri::command]
pub async fn start_core() -> CmdResult {
wrap_err!(CoreManager::global().start_core().await)
}
/// 关闭核心
#[tauri::command]
pub async fn stop_core() -> CmdResult {
wrap_err!(CoreManager::global().stop_core().await)
}
/// 重启核心
#[tauri::command]
pub async fn restart_core() -> CmdResult {

View File

@@ -1,7 +1,6 @@
use super::CmdResult;
use crate::{
core::{service, CoreManager},
feat,
utils::i18n::t,
};

View File

@@ -217,8 +217,11 @@ pub fn run() {
cmd::get_portable_flag,
cmd::get_network_interfaces,
cmd::get_system_hostname,
cmd::restart_core,
cmd::restart_app,
// 内核管理
cmd::start_core,
cmd::stop_core,
cmd::restart_core,
// 启动命令
cmd::notify_ui_ready,
cmd::update_ui_stage,