diff --git a/src/locales/en.json b/src/locales/en.json index 7d1b06bee2fe08fbe5e4c9a8c29215d4a2dbbb4e..e72831b67dcb0c949888c097ab4ee50269de83ff 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -13,6 +13,7 @@ "rule": "rule", "global": "global", "direct": "direct", + "script": "script", "Profiles": "Profiles", "Profile URL": "Profile URL", "Import": "Import", diff --git a/src/locales/zh.json b/src/locales/zh.json index 8894cfb35c8ebe356ec2f277bcd0f07d4fff6a56..4264184daf8753c84302d74db33f9ebd2086c95e 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -13,6 +13,7 @@ "rule": "规则", "global": "全局", "direct": "ç›´è¿ž", + "script": "脚本", "Profiles": "é…ç½®", "Profile URL": "é…置文件链接", "Import": "导入", diff --git a/src/pages/proxies.tsx b/src/pages/proxies.tsx index d848850bc24ed2ec4996616d0c3ebce94b78ad7f..7001bd5ce47aa0ff4b3c944e1c13bf721c70b61d 100644 --- a/src/pages/proxies.tsx +++ b/src/pages/proxies.tsx @@ -16,7 +16,7 @@ const ProxyPage = () => { const { data: proxiesData } = useSWR("getProxies", getProxies); const { data: clashConfig } = useSWR("getClashConfig", getClashConfig); - const modeList = ["rule", "global", "direct"]; + const modeList = ["rule", "global", "direct", "script"]; const curMode = clashConfig?.mode.toLowerCase(); const { groups = [], proxies = [] } = proxiesData ?? {}; @@ -38,7 +38,8 @@ const ProxyPage = () => { }); // difference style - const showGroup = curMode === "rule" && !!groups.length; + const showGroup = + (curMode === "rule" || curMode === "script") && !!groups.length; const pageStyle = showGroup ? {} : { height: "100%" }; const paperStyle: any = showGroup ? { mb: 0.5 } @@ -64,7 +65,7 @@ const ProxyPage = () => { } > <Paper sx={{ borderRadius: 1, boxShadow: 2, ...paperStyle }}> - {curMode === "rule" && !!groups.length && ( + {(curMode === "rule" || curMode === "script") && !!groups.length && ( <List> {groups.map((group) => ( <ProxyGroup key={group.name} group={group} />