feat: windows service mode ui

This commit is contained in:
GyDi
2022-04-25 16:12:04 +08:00
committed by GitHub
parent d8b9c3b832
commit d45ad76fbc
8 changed files with 234 additions and 14 deletions

View File

@@ -251,6 +251,11 @@ pub mod service {
wrap_err!(crate::core::Service::start_service().await)
}
#[tauri::command]
pub async fn stop_service() -> Result<(), String> {
wrap_err!(crate::core::Service::stop_service().await)
}
#[tauri::command]
pub async fn check_service() -> Result<JsonResponse, String> {
wrap_err!(crate::core::Service::check_service().await)
@@ -258,11 +263,13 @@ pub mod service {
#[tauri::command]
pub async fn install_service() -> Result<(), String> {
wrap_err!(crate::core::Service::install_service().await)
wrap_err!(crate::core::Service::install_service().await)?;
wrap_err!(crate::core::Service::start_service().await)
}
#[tauri::command]
pub async fn uninstall_service() -> Result<(), String> {
log_if_err!(crate::core::Service::stop_service().await);
wrap_err!(crate::core::Service::uninstall_service().await)
}
}
@@ -276,6 +283,11 @@ pub mod service {
Ok(())
}
#[tauri::command]
pub async fn stop_service() -> Result<(), String> {
Ok(())
}
#[tauri::command]
pub async fn check_service() -> Result<(), String> {
Ok(())