feat: reorganize service commands and implement logging for service management
This commit is contained in:
38
src-tauri/src/cmd/service.rs
Normal file
38
src-tauri/src/cmd/service.rs
Normal file
@@ -0,0 +1,38 @@
|
||||
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(())
|
||||
}
|
||||
Reference in New Issue
Block a user