diff --git a/src/components/ProxyNodeCard.tsx b/src/components/ProxyNodeCard.tsx index 4fde528..bac6bad 100644 --- a/src/components/ProxyNodeCard.tsx +++ b/src/components/ProxyNodeCard.tsx @@ -20,14 +20,21 @@ export const ProxyNodeCard = (props: { useProxies() const proxyNode = createMemo(() => proxyNodeMap()[proxyName]) - const specialType = () => - filterSpecialProxyType(proxyNode()?.type) - ? proxyNode()?.xudp - ? 'xudp' - : proxyNode()?.udp - ? 'udp' - : null - : null + const specialTypes = createMemo(() => { + if (!filterSpecialProxyType(proxyNode()?.type)) return null + + return `(${[ + proxyNode().xudp && 'xudp', + proxyNode().udp && 'udp', + proxyNode().tfo && 'TFO', + ] + .filter(Boolean) + .join(' / ')})` + }) + + const title = createMemo(() => + [proxyName, specialTypes()].filter(Boolean).join(' - '), + ) return (
@@ -79,15 +86,8 @@ export const ProxyNodeCard = (props: {

{proxyName}

-
- {[specialType(), proxyNode().tfo && 'TFO'] - .filter(Boolean) - .join(' / ')} +
+ {specialTypes()}
    diff --git a/src/helpers/proxies.ts b/src/helpers/proxies.ts index 17ae6d3..56890ee 100644 --- a/src/helpers/proxies.ts +++ b/src/helpers/proxies.ts @@ -32,7 +32,6 @@ export const getLatencyClassName = (latency: LATENCY_QUALITY_MAP_HTTP) => { } export const filterSpecialProxyType = (type = '') => { - const t = type.toLowerCase() const conditions = [ 'selector', 'direct', @@ -43,7 +42,7 @@ export const filterSpecialProxyType = (type = '') => { 'relay', ] - return !conditions.includes(t) + return !conditions.includes(type.toLowerCase()) } export const sortProxiesByOrderingType = (