feat: windows service mode ui

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

View File

@@ -112,8 +112,19 @@ export async function startService() {
return invoke<void>("start_service");
}
export async function stopService() {
return invoke<void>("stop_service");
}
export async function checkService() {
return invoke<any>("check_service");
try {
const result = await invoke<any>("check_service");
if (result?.code === 0) return "active";
if (result?.code === 400) return "installed";
return "unknown";
} catch (err: any) {
return "uninstall";
}
}
export async function installService() {