mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-26 09:12:10 +03:00
fix(panel): read outbound protocol ids case-insensitively everywhere (#6523)
Six more readers compared an outbound's protocol id exactly while the core lowercases it, so an outbound spelled "Blackhole" passed every excludeBlackhole filter (offered as an mtproto egress, a dialerProxy target and the geodata download egress, all of which then drop the traffic) and one spelled "Freedom" was queued by Test All Outbounds. They now share isOutboundProtocol.
This commit is contained in:
@@ -2,6 +2,7 @@ import { useQuery } from '@tanstack/react-query';
|
||||
|
||||
import { keys } from '@/api/queryKeys';
|
||||
import { fetchXrayConfig } from '@/hooks/useXraySetting';
|
||||
import { isOutboundProtocol } from '@/schemas/primitives';
|
||||
|
||||
// Available outbound (and balancer-eligible) tags the user can route an mtproto
|
||||
// inbound's Telegram traffic to. Shares the cached xray config query so opening
|
||||
@@ -18,7 +19,7 @@ export function useOutboundTags(opts?: { excludeBlackhole?: boolean }) {
|
||||
for (const o of data?.xraySetting?.outbounds ?? []) {
|
||||
const ob = o as { tag?: string; protocol?: string } | null;
|
||||
if (!ob?.tag) continue;
|
||||
if (excludeBlackhole && ob.protocol === 'blackhole') continue;
|
||||
if (excludeBlackhole && isOutboundProtocol(ob, 'blackhole')) continue;
|
||||
tags.add(ob.tag);
|
||||
}
|
||||
for (const t of data?.subscriptionOutboundTags ?? []) {
|
||||
@@ -56,7 +57,7 @@ export function useOutboundTagGroups(opts?: { excludeBlackhole?: boolean }) {
|
||||
for (const o of data?.xraySetting?.outbounds ?? []) {
|
||||
const ob = o as { tag?: string; protocol?: string } | null;
|
||||
if (!ob?.tag) continue;
|
||||
if (excludeBlackhole && ob.protocol === 'blackhole') continue;
|
||||
if (excludeBlackhole && isOutboundProtocol(ob, 'blackhole')) continue;
|
||||
outbounds.add(ob.tag);
|
||||
}
|
||||
for (const t of data?.subscriptionOutboundTags ?? []) {
|
||||
|
||||
Reference in New Issue
Block a user