From 45fdebeacab6593501766a89544b2c53664de5db Mon Sep 17 00:00:00 2001 From: wonfen Date: Mon, 1 Sep 2025 13:57:04 +0800 Subject: [PATCH] style: simplify and improve proxy settings UI --- UPDATELOG.md | 15 +- .../shared/ProxyControlSwitches.tsx | 235 +++++++----------- 2 files changed, 104 insertions(+), 146 deletions(-) diff --git a/UPDATELOG.md b/UPDATELOG.md index e0ac3320..363bb0c5 100644 --- a/UPDATELOG.md +++ b/UPDATELOG.md @@ -1,6 +1,19 @@ ## v2.4.2 -To be done +### ✨ 新增功能 + +- 增加托盘节点选择 + +### 🐞 修复问题 + +- 修复首页节点切换失效的问题 +- 修复和优化服务检查流程 +- 修复2.4.1引入的订阅地址重定向报错问题 +- 修复 rpm/deb 包名称问题 + +### 👙 界面样式 + +- 简化和改进代理设置样式 ## v2.4.1 diff --git a/src/components/shared/ProxyControlSwitches.tsx b/src/components/shared/ProxyControlSwitches.tsx index 30c93db7..b8926aa1 100644 --- a/src/components/shared/ProxyControlSwitches.tsx +++ b/src/components/shared/ProxyControlSwitches.tsx @@ -8,15 +8,9 @@ import { DeleteForeverRounded, WarningRounded, } from "@mui/icons-material"; -import { - Box, - Button, - Tooltip, - Typography, - alpha, - useTheme, -} from "@mui/material"; +import { Box, Typography, alpha, useTheme } from "@mui/material"; import { DialogRef, Switch } from "@/components/base"; +import { TooltipIcon } from "@/components/base/base-tooltip-icon"; import { GuardState } from "@/components/setting/mods/guard-state"; import { SysproxyViewer } from "@/components/setting/mods/sysproxy-viewer"; import { TunViewer } from "@/components/setting/mods/tun-viewer"; @@ -100,19 +94,6 @@ const ProxyControlSwitches = ({ return ( - {label && ( - - {label} - - )} - {/* 仅显示当前选中的开关 */} {isSystemProxyMode && ( {systemProxyActualState ? ( - + ) : ( )} - - - {t("System Proxy")} - - - - - - - sysproxyRef.current?.open()} - > - - - - - toggleSystemProxy(e)} + - - + {t("System Proxy")} + + sysproxyRef.current?.open()} + sx={{ ml: 1 }} + /> + + toggleSystemProxy(e)} + > + + )} @@ -196,109 +163,87 @@ const ProxyControlSwitches = ({ > {enable_tun_mode ? ( - + ) : ( )} - - - {t("Tun Mode")} - - + + {t("Tun Mode")} + + tunRef.current?.open()} + sx={{ ml: 1 }} + /> {!isTunAvailable && ( - - - + icon={WarningRounded} + sx={{ color: "warning.main", ml: 1 }} + /> )} - - {!isTunAvailable && ( - - - + )} {isServiceMode && ( - - - + )} - - - tunRef.current?.open()} - > - - - - - { - if (!isTunAvailable) { - showNotice( - "error", - t("TUN requires Service Mode or Admin Mode"), - ); - return Promise.reject( - new Error(t("TUN requires Service Mode or Admin Mode")), - ); - } - onChangeData({ enable_tun_mode: e }); - }} - onGuard={(e) => { - if (!isTunAvailable) { - showNotice( - "error", - t("TUN requires Service Mode or Admin Mode"), - ); - return Promise.reject( - new Error(t("TUN requires Service Mode or Admin Mode")), - ); - } - return patchVerge({ enable_tun_mode: e }); - }} - > - - + + { + if (!isTunAvailable) { + showNotice( + "error", + t("TUN requires Service Mode or Admin Mode"), + ); + return Promise.reject( + new Error(t("TUN requires Service Mode or Admin Mode")), + ); + } + onChangeData({ enable_tun_mode: e }); + }} + onGuard={(e) => { + if (!isTunAvailable) { + showNotice( + "error", + t("TUN requires Service Mode or Admin Mode"), + ); + return Promise.reject( + new Error(t("TUN requires Service Mode or Admin Mode")), + ); + } + return patchVerge({ enable_tun_mode: e }); + }} + > + + )}