summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorkunish <[email protected]>2023-01-28 00:28:26 +0800
committerkunish <[email protected]>2023-01-28 00:33:45 +0800
commit145d21f1008548133deaaf51e4c99069c5181b4e (patch)
treed3371f6e53c74fb47c706d3b75d16a9d781041b1 /src/components
parent2ef9968cba6918f4f07982b316bd1afed82ca9b7 (diff)
feat: display `xudp` type
Diffstat (limited to 'src/components')
-rw-r--r--src/components/proxies/Proxy.tsx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/components/proxies/Proxy.tsx b/src/components/proxies/Proxy.tsx
index bd23ab7..d559744 100644
--- a/src/components/proxies/Proxy.tsx
+++ b/src/components/proxies/Proxy.tsx
@@ -3,6 +3,7 @@ import cx from 'clsx';
import * as React from 'react';
import { keyCodes } from '~/misc/keycode';
+import { ProxyItem } from '~/store/types';
import { getDelay, getProxies, NonProxyTypes } from '../../store/proxies';
import { connect } from '../StateProvider';
@@ -54,7 +55,7 @@ function getProxyDotBackgroundColor(
type ProxyProps = {
name: string;
now?: boolean;
- proxy: any;
+ proxy: ProxyItem;
latency: any;
isSelectable?: boolean;
udp: boolean;
@@ -136,9 +137,9 @@ function ProxyImpl({ now, name, proxy, latency, isSelectable, onClick }: ProxyPr
const doSelect = React.useCallback(() => {
isSelectable && onClick && onClick(name);
}, [name, onClick, isSelectable]);
- function formatUdpType(t: boolean) {
- if (!t) return '';
- return 'UDP';
+ function formatUdpType(udp: boolean, xudp?: boolean) {
+ if (!udp) return '';
+ return xudp ? 'XUDP' : 'UDP';
}
function formatTfo(t: boolean) {
if (!t) return '';
@@ -187,7 +188,7 @@ function ProxyImpl({ now, name, proxy, latency, isSelectable, onClick }: ProxyPr
<span>{name}</span>
</ProxyNameTooltip>
<span className={s0.proxyType} style={{ paddingLeft: 4, opacity: now ? 0.6 : 0.2 }}>
- {formatUdpType(proxy.udp)}
+ {formatUdpType(proxy.udp, proxy.xudp)}
</span>
</div>