feat(proxy-groups): filter available groups to show only Selector types in chain mode

This commit is contained in:
Tunglies 2025-12-10 10:04:20 +08:00
parent 2b552d6ddb
commit dfa5cff1b7
No known key found for this signature in database
GPG Key ID: B9B01B389469B3E8
2 changed files with 9 additions and 2 deletions

View File

@ -61,6 +61,7 @@
- 优化前端 WebSocket 连接机制
- 改进旧版 Service 需要重新安装检测流程
- 优化 macOS, Linux 和 Windows 系统信号处理
- 链式代理仅显示 Selector 类型规则组
</details>

View File

@ -27,8 +27,8 @@ import { ScrollTopButton } from "../layout/scroll-top-button";
import { ProxyChain } from "./proxy-chain";
import {
ProxyGroupNavigator,
DEFAULT_HOVER_DELAY,
ProxyGroupNavigator,
} from "./proxy-group-navigator";
import { ProxyRender } from "./proxy-render";
import { useRenderList } from "./use-render-list";
@ -64,7 +64,13 @@ export const ProxyGroups = (props: Props) => {
const { verge } = useVerge();
const { proxies: proxiesData } = useProxiesData();
const groups = proxiesData?.groups;
const availableGroups = useMemo(() => groups ?? [], [groups]);
const availableGroups = useMemo(() => {
if (!groups) return [];
// 在链式代理模式下,仅显示支持选择节点的 Selector 代理组
return isChainMode
? groups.filter((g: any) => g.type === "Selector")
: groups;
}, [groups, isChainMode]);
const defaultRuleGroup = useMemo(() => {
if (isChainMode && mode === "rule" && availableGroups.length > 0) {