mirror of
https://github.com/coder/coder.git
synced 2026-10-29 17:44:33 +08:00
feat: add derp only text to proxies list in dashboard (#8932)
This commit is contained in:
@@ -23,11 +23,15 @@ export const EntitledBadge: FC = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const HealthyBadge: FC = () => {
|
export const HealthyBadge: FC<{ derpOnly: boolean }> = ({ derpOnly }) => {
|
||||||
const styles = useStyles()
|
const styles = useStyles()
|
||||||
|
let text = "Healthy"
|
||||||
|
if (derpOnly) {
|
||||||
|
text = "Healthy (DERP Only)"
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<span className={combineClasses([styles.badge, styles.enabledBadge])}>
|
<span className={combineClasses([styles.badge, styles.enabledBadge])}>
|
||||||
Healthy
|
{text}
|
||||||
</span>
|
</span>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,9 +169,14 @@ const DetailedProxyStatus: FC<{
|
|||||||
return <ProxyStatus proxy={proxy} />
|
return <ProxyStatus proxy={proxy} />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let derpOnly = false
|
||||||
|
if ("derp_only" in proxy) {
|
||||||
|
derpOnly = proxy.derp_only
|
||||||
|
}
|
||||||
|
|
||||||
switch (proxy.status.status) {
|
switch (proxy.status.status) {
|
||||||
case "ok":
|
case "ok":
|
||||||
return <HealthyBadge />
|
return <HealthyBadge derpOnly={derpOnly} />
|
||||||
case "unhealthy":
|
case "unhealthy":
|
||||||
return <NotHealthyBadge />
|
return <NotHealthyBadge />
|
||||||
case "unreachable":
|
case "unreachable":
|
||||||
@@ -189,7 +194,7 @@ const ProxyStatus: FC<{
|
|||||||
}> = ({ proxy }) => {
|
}> = ({ proxy }) => {
|
||||||
let icon = <NotHealthyBadge />
|
let icon = <NotHealthyBadge />
|
||||||
if (proxy.healthy) {
|
if (proxy.healthy) {
|
||||||
icon = <HealthyBadge />
|
icon = <HealthyBadge derpOnly={false} />
|
||||||
}
|
}
|
||||||
|
|
||||||
return icon
|
return icon
|
||||||
|
|||||||
Reference in New Issue
Block a user