From 2d0b63c29d9ee99841fdfd2d951b16859694f247 Mon Sep 17 00:00:00 2001
From: GyDi <segydi@foxmail.com>
Date: Sun, 24 Apr 2022 21:03:47 +0800
Subject: [PATCH] feat: add some commands

---
 src/services/cmds.ts  | 18 ++++++++++++++++++
 src/services/types.ts |  1 +
 2 files changed, 19 insertions(+)

diff --git a/src/services/cmds.ts b/src/services/cmds.ts
index 4cc2559..28619a6 100644
--- a/src/services/cmds.ts
+++ b/src/services/cmds.ts
@@ -105,3 +105,21 @@ export async function openLogsDir() {
     Notice.error(err?.message || err.toString(), 1500)
   );
 }
+
+/// service mode
+
+export async function startService() {
+  return invoke<void>("start_service");
+}
+
+export async function checkService() {
+  return invoke<any>("check_service");
+}
+
+export async function installService() {
+  return invoke<void>("install_service");
+}
+
+export async function uninstallService() {
+  return invoke<void>("uninstall_service");
+}
diff --git a/src/services/types.ts b/src/services/types.ts
index 9e76a8e..9a38b2d 100644
--- a/src/services/types.ts
+++ b/src/services/types.ts
@@ -130,6 +130,7 @@ export namespace CmdType {
     traffic_graph?: boolean;
     enable_tun_mode?: boolean;
     enable_auto_launch?: boolean;
+    enable_service_mode?: boolean;
     enable_silent_start?: boolean;
     enable_system_proxy?: boolean;
     enable_proxy_guard?: boolean;
-- 
GitLab