feat: add UWP loopback tools

This commit is contained in:
Kuingsmile
2023-11-22 00:15:41 -08:00
parent 7ec251ea6d
commit caa82ad1e6
10 changed files with 88 additions and 0 deletions

View File

@@ -18,6 +18,10 @@ import { ClashPortViewer } from "./mods/clash-port-viewer";
import { ControllerViewer } from "./mods/controller-viewer";
import { SettingList, SettingItem } from "./mods/setting-comp";
import { ClashCoreViewer } from "./mods/clash-core-viewer";
import { invoke_uwp_tool } from "@/services/cmds";
import getSystem from "@/utils/get-system";
const isWIN = getSystem() === "windows";
interface Props {
onError: (err: Error) => void;
@@ -162,6 +166,19 @@ const SettingClash = ({ onError }: Props) => {
>
<Typography sx={{ py: "7px", pr: 1 }}>{version}</Typography>
</SettingItem>
{isWIN && (
<SettingItem label={t("Open UWP tool")}>
<IconButton
color="inherit"
size="small"
sx={{ my: "2px" }}
onClick={invoke_uwp_tool}
>
<ArrowForward />
</IconButton>
</SettingItem>
)}
</SettingList>
);
};

View File

@@ -75,6 +75,7 @@
"Silent Start": "Silent Start",
"System Proxy": "System Proxy",
"System Proxy Setting": "System Proxy Setting",
"Open UWP tool": "Open UWP tool",
"Proxy Guard": "Proxy Guard",
"Guard Duration": "Guard Duration",
"Proxy Bypass": "Proxy Bypass",

View File

@@ -71,6 +71,7 @@
"Silent Start": "Тихий запуск",
"System Proxy": "Системный прокси",
"System Proxy Setting": "Настройка системного прокси",
"Open UWP tool": "Открыть UWP инструмент",
"Proxy Guard": "Защита прокси",
"Guard Duration": "Период защиты",
"Proxy Bypass": "Игнорирование прокси",

View File

@@ -75,6 +75,7 @@
"Silent Start": "静默启动",
"System Proxy": "系统代理",
"System Proxy Setting": "系统代理设置",
"Open UWP tool": "UWP工具",
"Proxy Guard": "系统代理守卫",
"Guard Duration": "代理守卫间隔",
"Proxy Bypass": "代理绕过",

View File

@@ -178,3 +178,9 @@ export async function installService() {
export async function uninstallService() {
return invoke<void>("uninstall_service");
}
export async function invoke_uwp_tool() {
return invoke<void>("invoke_uwp_tool").catch((err) =>
Notice.error(err?.message || err.toString(), 1500)
);
}