feat: tray enhance (#5058)

* feat: proxy group sorting for tray

* feat(tray): add inline proxy groups toggle
This commit is contained in:
Sline
2025-10-14 17:03:37 +08:00
committed by GitHub
parent 98527d5038
commit f541464ff4
7 changed files with 113 additions and 59 deletions

View File

@@ -22,6 +22,7 @@ import { useWindowDecorations } from "@/hooks/use-window";
import { copyIconFile, getAppDir } from "@/services/cmds";
import { showNotice } from "@/services/noticeService";
import getSystem from "@/utils/get-system";
import { GuardState } from "./guard-state";
const OS = getSystem();
@@ -263,6 +264,19 @@ export const LayoutViewer = forwardRef<DialogRef>((props, ref) => {
</GuardState>
</Item>
)}
<Item>
<ListItemText primary={t("Show Proxy Groups Inline")} />
<GuardState
value={verge?.tray_inline_proxy_groups ?? false}
valueProps="checked"
onCatch={onError}
onFormat={onSwitchFormat}
onChange={(e) => onChangeData({ tray_inline_proxy_groups: e })}
onGuard={(e) => patchVerge({ tray_inline_proxy_groups: e })}
>
<Switch edge="end" />
</GuardState>
</Item>
<Item>
<ListItemText primary={t("Common Tray Icon")} />

View File

@@ -512,6 +512,7 @@
"Direct Mode": "Direct Mode",
"Enable Tray Speed": "Enable Tray Speed",
"Enable Tray Icon": "Enable Tray Icon",
"Show Proxy Groups Inline": "Show Proxy Groups Inline",
"LightWeight Mode": "Lightweight Mode",
"LightWeight Mode Info": "Close the GUI and keep only the kernel running",
"LightWeight Mode Settings": "LightWeight Mode Settings",

View File

@@ -512,6 +512,7 @@
"Direct Mode": "直连模式",
"Enable Tray Speed": "启用托盘速率",
"Enable Tray Icon": "启用托盘图标",
"Show Proxy Groups Inline": "将代理组显示在托盘一级菜单",
"LightWeight Mode": "轻量模式",
"LightWeight Mode Info": "关闭GUI界面仅保留内核运行",
"LightWeight Mode Settings": "轻量模式设置",

View File

@@ -437,6 +437,7 @@
"Direct Mode": "直連模式",
"Enable Tray Speed": "啟用托盤速率",
"Enable Tray Icon": "啟用托盤圖標",
"Show Proxy Groups Inline": "將代理組顯示在托盤一級選單",
"LightWeight Mode": "輕量模式",
"LightWeight Mode Info": "關閉GUI界面僅保留內核運行",
"LightWeight Mode Settings": "輕量模式設置",

View File

@@ -802,6 +802,7 @@ interface IVergeConfig {
tun_tray_icon?: boolean;
enable_tray_speed?: boolean;
enable_tray_icon?: boolean;
tray_inline_proxy_groups?: boolean;
enable_tun_mode?: boolean;
enable_auto_light_weight_mode?: boolean;
auto_light_weight_minutes?: number;