summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authormetacubex <[email protected]>2022-11-08 23:33:46 +0800
committermetacubex <[email protected]>2022-11-08 23:33:46 +0800
commitaca76c6f95de8b307b5896ec44aa6538b276fde5 (patch)
tree92f4acc2ae36f8026e425cb2d3090c27d4a575c3 /src/components
parent4c77ea3e9c0561f3ff99795b15da907aa2b1f263 (diff)
chore: adjust UDP tag
Diffstat (limited to 'src/components')
-rw-r--r--src/components/proxies/Proxy.tsx17
-rw-r--r--src/components/proxies/ProxyGroup.tsx2
2 files changed, 9 insertions, 10 deletions
diff --git a/src/components/proxies/Proxy.tsx b/src/components/proxies/Proxy.tsx
index 3f5ab39..a52d219 100644
--- a/src/components/proxies/Proxy.tsx
+++ b/src/components/proxies/Proxy.tsx
@@ -64,14 +64,14 @@ function ProxySmallImpl({
now,
name,
proxy,
- latency,
+ latency,
isSelectable,
onClick,
}: ProxyProps) {
const color = useMemo(() => getProxyDotBackgroundColor(latency, proxy.type), [
latency,
proxy,
-
+
]);
const title = useMemo(() => {
let ret = name;
@@ -106,7 +106,7 @@ function ProxySmallImpl({
title={title}
className={className}
style={{ background: color }}
- onClick={doSelect}
+ onClick={doSelect}
onKeyDown={handleKeyDown}
role={isSelectable ? 'menuitem' : ''}
/>
@@ -139,6 +139,7 @@ function ProxyNameTooltip({ children, label, 'aria-label': ariaLabel }) {
</>
);
}
+
function ProxyImpl({
now,
name,
@@ -154,7 +155,7 @@ function ProxyImpl({
}, [name, onClick, isSelectable]);
function formatUdpType (t: boolean) {
if (!t) return '';
- return 'udp';
+ return 'UDP';
}
const handleKeyDown = React.useCallback(
(e: React.KeyboardEvent) => {
@@ -180,17 +181,15 @@ function ProxyImpl({
onKeyDown={handleKeyDown}
role={isSelectable ? 'menuitem' : ''}
>
- <div className={s0.proxyName}>
+ <div className={`${s0.proxyName} ${s0.row}`}>
<ProxyNameTooltip label={name} aria-label={'proxy name: ' + name}>
<span>{name}</span>
</ProxyNameTooltip>
+ <span className={s0.proxyType} style={{ opacity: now ? 0.6 : 0.2 }}>{formatUdpType(proxy.udp)}</span>
</div>
<div className={s0.row}>
<span className={s0.proxyType} style={{ opacity: now ? 0.6 : 0.2 }}>
- {proxy.udp ? formatProxyType(proxy.type)+" udp":formatProxyType(proxy.type)}
- </span>
- <span className={s0.udpType}>
- {formatUdpType(udp)}
+ {formatProxyType(proxy.type)}
</span>
{latency && latency.number ? (
<ProxyLatency number={latency.number} color={color} />
diff --git a/src/components/proxies/ProxyGroup.tsx b/src/components/proxies/ProxyGroup.tsx
index ad39fb8..7b3b236 100644
--- a/src/components/proxies/ProxyGroup.tsx
+++ b/src/components/proxies/ProxyGroup.tsx
@@ -73,7 +73,7 @@ function ProxyGroupImpl({
const testLatency = useCallback(async () => {
setIsTestingLatency(true);
try {
- if (version.meta==true){
+ if (version.meta===true){
await proxiesAPI.requestDelayForProxyGroup(apiConfig, name);
await dispatch(fetchProxies(apiConfig));}
else{