feat: Service Mode for Linux (#804)

This commit is contained in:
HZ is not Chatty
2024-03-31 16:16:23 +08:00
committed by GitHub
parent 503579a638
commit b0f1ce1fa0
12 changed files with 180 additions and 29 deletions

View File

@@ -331,28 +331,28 @@ pub fn exit_app(app_handle: tauri::AppHandle) {
std::process::exit(0);
}
#[cfg(windows)]
#[cfg(any(windows, target_os = "linux"))]
pub mod service {
use super::*;
use crate::core::win_service;
use crate::core::service;
#[tauri::command]
pub async fn check_service() -> CmdResult<win_service::JsonResponse> {
wrap_err!(win_service::check_service().await)
pub async fn check_service() -> CmdResult<service::JsonResponse> {
wrap_err!(service::check_service().await)
}
#[tauri::command]
pub async fn install_service() -> CmdResult {
wrap_err!(win_service::install_service().await)
wrap_err!(service::install_service().await)
}
#[tauri::command]
pub async fn uninstall_service() -> CmdResult {
wrap_err!(win_service::uninstall_service().await)
wrap_err!(service::uninstall_service().await)
}
}
#[cfg(not(windows))]
#[cfg(not(any(windows, target_os = "linux")))]
pub mod service {
use super::*;