mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-09-28 17:46:44 +00:00
Update health-status-modal.tsx
This commit is contained in:
@@ -279,21 +279,14 @@ export function HealthStatusModal({ open, onOpenChange, getApiUrl }: HealthStatu
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getStatusBadge = (status: string) => {
|
const getStatusBadge = (status: string) => {
|
||||||
const statusUpper = status?.toUpperCase()
|
const s = status?.toUpperCase()
|
||||||
switch (statusUpper) {
|
const label =
|
||||||
case "OK":
|
s === "OK" ? t("healthStatus.status.ok") :
|
||||||
return <Badge className="bg-green-500 text-white hover:bg-green-500">{t("healthStatus.status.ok")}</Badge>
|
s === "INFO" ? t("healthStatus.status.info") :
|
||||||
case "INFO":
|
s === "WARNING" ? t("healthStatus.status.warning") :
|
||||||
return <Badge className="bg-blue-500 text-white hover:bg-blue-500">{t("healthStatus.status.info")}</Badge>
|
s === "CRITICAL" ? t("healthStatus.status.critical") :
|
||||||
case "WARNING":
|
t("healthStatus.status.unknown")
|
||||||
return <Badge className="bg-yellow-500 text-white hover:bg-yellow-500">{t("healthStatus.status.warning")}</Badge>
|
return <Badge variant="outline" className={getOutlineBadgeStyle(status)}>{label}</Badge>
|
||||||
case "CRITICAL":
|
|
||||||
return <Badge className="bg-red-500 text-white hover:bg-red-500">{t("healthStatus.status.critical")}</Badge>
|
|
||||||
case "UNKNOWN":
|
|
||||||
return <Badge className="bg-amber-500 text-white hover:bg-amber-500">{t("healthStatus.status.unknown")}</Badge>
|
|
||||||
default:
|
|
||||||
return <Badge>{t("healthStatus.status.unknown")}</Badge>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatStatus = (status: string) => {
|
const formatStatus = (status: string) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user