mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-15 06:45:36 +08:00
feat(proxies): show latency result only when possible
This commit is contained in:
parent
dfcc750a12
commit
4314e64785
@ -68,7 +68,9 @@ export const ProxyPreviewBar = (props: {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Latency proxyName={props.now} />
|
<Show when={props.now}>
|
||||||
|
<Latency proxyName={props.now!} />
|
||||||
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import { twMerge } from 'tailwind-merge'
|
|||||||
import { Latency } from '~/components'
|
import { Latency } from '~/components'
|
||||||
import { latencyQualityMap, useProxies } from '~/signals'
|
import { latencyQualityMap, useProxies } from '~/signals'
|
||||||
|
|
||||||
const LatencyDots = (props: {
|
const LatencyDot = (props: {
|
||||||
name: string
|
name: string
|
||||||
latency?: number
|
latency?: number
|
||||||
selected: boolean
|
selected: boolean
|
||||||
@ -51,21 +51,19 @@ export const ProxyPreviewDots = (props: {
|
|||||||
getLatencyByName(name),
|
getLatencyByName(name),
|
||||||
])}
|
])}
|
||||||
>
|
>
|
||||||
{([name, latency]) => {
|
{([name, latency]) => (
|
||||||
const isSelected = props.now === name
|
<LatencyDot
|
||||||
|
|
||||||
return (
|
|
||||||
<LatencyDots
|
|
||||||
name={name}
|
name={name}
|
||||||
latency={latency}
|
latency={latency}
|
||||||
selected={isSelected}
|
selected={props.now === name}
|
||||||
/>
|
/>
|
||||||
)
|
)}
|
||||||
}}
|
|
||||||
</For>
|
</For>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Latency proxyName={props.now} />
|
<Show when={props.now}>
|
||||||
|
<Latency proxyName={props.now!} />
|
||||||
|
</Show>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user