diff --git a/public/locales/en/common.json b/public/locales/en/common.json index a4a7a32f0..cd6012f8a 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -79,10 +79,12 @@ "partial": "Partial" }, "ping": { + "http_status": "HTTP status", "error": "Error", "ping": "Ping", "down": "Down", - "up": "Up" + "up": "Up", + "not_available": "Not Available" }, "emby": { "playing": "Playing", diff --git a/src/components/services/kubernetes-status.jsx b/src/components/services/kubernetes-status.jsx index 0618e5741..7d1bfa70c 100644 --- a/src/components/services/kubernetes-status.jsx +++ b/src/components/services/kubernetes-status.jsx @@ -29,7 +29,7 @@ export default function KubernetesStatus({ service, style }) { } if (style === 'dot') { - colorClass = colorClass.replace('text-', 'bg-').replace(/\/\d\d$/, ''); + colorClass = colorClass.replace('text-', 'bg-').replace(/\/\d\d/, ''); backgroundClass = "p-3 hover:bg-theme-500/10 dark:hover:bg-theme-900/20"; } diff --git a/src/components/services/ping.jsx b/src/components/services/ping.jsx index 37ef1a1db..a6b46f17e 100644 --- a/src/components/services/ping.jsx +++ b/src/components/services/ping.jsx @@ -7,44 +7,43 @@ export default function Ping({ group, service, style }) { refreshInterval: 30000 }); - let colorClass = "" + let colorClass = "text-black/20 dark:text-white/40"; let backgroundClass = "bg-theme-500/10 dark:bg-theme-900/50 px-1.5 py-0.5"; - let statusTitle = "HTTP status"; - let statusText; + let statusTitle = t("ping.http_status"); + let statusText = ""; if (error) { - colorClass = "text-rose-500" - statusText = t("ping.error") - statusTitle += " error" + colorClass = "text-rose-500"; + statusText = t("ping.error"); + statusTitle += ` ${t("ping.error")}`; } else if (!data) { - colorClass = "text-black/20 dark:text-white/40" - statusText = t("ping.ping") - statusTitle += " not available" + statusText = t("ping.ping"); + statusTitle += ` ${t("ping.not_available")}`; } else if (data.status > 403) { - colorClass = "text-rose-500/80" - statusTitle += ` ${data.status}` + colorClass = "text-rose-500/80"; + statusTitle += ` ${data.status}`; if (style === "basic") { - statusText = t("ping.down") + statusText = t("ping.down"); } else { - statusText = data.status + statusText = data.status; } } else { const ping = t("common.ms", { value: data.latency, style: "unit", unit: "millisecond", maximumFractionDigits: 0 }) statusTitle += ` ${data.status} (${ping})`; - colorClass = "text-emerald-500/80" + colorClass = "text-emerald-500/80"; if (style === "basic") { - statusText = t("ping.up") + statusText = t("ping.up"); } else { - statusText = ping - colorClass += " lowercase" + statusText = ping; + colorClass += " lowercase"; } } if (style === "dot") { backgroundClass = 'p-3'; - colorClass = colorClass.replace('text-', 'bg-').replace(/\/\d\d$/, ''); + colorClass = colorClass.replace('text-', 'bg-').replace(/\/\d\d/, ''); } return (