mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-12-25 07:04:11 +08:00
fix: fixed latency color (#1251)
This commit is contained in:
parent
aec579b372
commit
1a66ee6847
@ -44,19 +44,19 @@ export const ProxyPreviewBar = (props: {
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="my-1 flex flex-1 items-center justify-center overflow-hidden rounded-2xl [&>*]:h-2">
|
||||
<div
|
||||
class="bg-success"
|
||||
class="bg-green-600"
|
||||
style={{
|
||||
width: `${(good() * 100) / all()}%`, // cant use tw class, otherwise dynamic classname won't be generated
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
class="bg-warning"
|
||||
class="bg-yellow-500"
|
||||
style={{
|
||||
width: `${(middle() * 100) / all()}%`,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
class="bg-error"
|
||||
class="bg-red-500"
|
||||
style={{
|
||||
width: `${(slow() * 100) / all()}%`,
|
||||
}}
|
||||
|
@ -8,8 +8,8 @@ const LatencyDot = (props: {
|
||||
selected: boolean
|
||||
}) => {
|
||||
let dotClassName = props.selected
|
||||
? 'bg-white border-4 border-success'
|
||||
: 'bg-success'
|
||||
? 'bg-white border-4 border-green-600'
|
||||
: 'bg-green-600'
|
||||
|
||||
if (
|
||||
typeof props.latency !== 'number' ||
|
||||
@ -20,12 +20,12 @@ const LatencyDot = (props: {
|
||||
: 'bg-neutral'
|
||||
} else if (props.latency > latencyQualityMap().HIGH) {
|
||||
dotClassName = props.selected
|
||||
? 'bg-white border-4 border-error'
|
||||
: 'bg-error'
|
||||
? 'bg-white border-4 border-red-500'
|
||||
: 'bg-red-500'
|
||||
} else if (props.latency > latencyQualityMap().MEDIUM) {
|
||||
dotClassName = props.selected
|
||||
? 'bg-white border-4 border-warning'
|
||||
: 'bg-warning'
|
||||
? 'bg-white border-4 border-yellow-500'
|
||||
: 'bg-yellow-500'
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -31,13 +31,13 @@ export const formatProxyType = (type = '') => {
|
||||
|
||||
export const getLatencyClassName = (latency: LATENCY_QUALITY_MAP_HTTP) => {
|
||||
if (latency > latencyQualityMap().HIGH) {
|
||||
return 'text-error'
|
||||
return 'text-red-500'
|
||||
} else if (latency > latencyQualityMap().MEDIUM) {
|
||||
return 'text-warning'
|
||||
return 'text-yellow-500'
|
||||
} else if (latency === LATENCY_QUALITY_MAP_HTTP.NOT_CONNECTED) {
|
||||
return 'text-gray'
|
||||
} else {
|
||||
return 'text-success'
|
||||
return 'text-green-600'
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user