Fix: dot visibility in some cases, translation strings (#2129)

pull/2131/head
shamoon 8 months ago committed by GitHub
parent ed3055ae1b
commit b765330b4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -79,10 +79,12 @@
"partial": "Partial" "partial": "Partial"
}, },
"ping": { "ping": {
"http_status": "HTTP status",
"error": "Error", "error": "Error",
"ping": "Ping", "ping": "Ping",
"down": "Down", "down": "Down",
"up": "Up" "up": "Up",
"not_available": "Not Available"
}, },
"emby": { "emby": {
"playing": "Playing", "playing": "Playing",

@ -29,7 +29,7 @@ export default function KubernetesStatus({ service, style }) {
} }
if (style === 'dot') { 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"; backgroundClass = "p-3 hover:bg-theme-500/10 dark:hover:bg-theme-900/20";
} }

@ -7,44 +7,43 @@ export default function Ping({ group, service, style }) {
refreshInterval: 30000 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 backgroundClass = "bg-theme-500/10 dark:bg-theme-900/50 px-1.5 py-0.5";
let statusTitle = "HTTP status"; let statusTitle = t("ping.http_status");
let statusText; let statusText = "";
if (error) { if (error) {
colorClass = "text-rose-500" colorClass = "text-rose-500";
statusText = t("ping.error") statusText = t("ping.error");
statusTitle += " error" statusTitle += ` ${t("ping.error")}`;
} else if (!data) { } else if (!data) {
colorClass = "text-black/20 dark:text-white/40" statusText = t("ping.ping");
statusText = t("ping.ping") statusTitle += ` ${t("ping.not_available")}`;
statusTitle += " not available"
} else if (data.status > 403) { } else if (data.status > 403) {
colorClass = "text-rose-500/80" colorClass = "text-rose-500/80";
statusTitle += ` ${data.status}` statusTitle += ` ${data.status}`;
if (style === "basic") { if (style === "basic") {
statusText = t("ping.down") statusText = t("ping.down");
} else { } else {
statusText = data.status statusText = data.status;
} }
} else { } else {
const ping = t("common.ms", { value: data.latency, style: "unit", unit: "millisecond", maximumFractionDigits: 0 }) const ping = t("common.ms", { value: data.latency, style: "unit", unit: "millisecond", maximumFractionDigits: 0 })
statusTitle += ` ${data.status} (${ping})`; statusTitle += ` ${data.status} (${ping})`;
colorClass = "text-emerald-500/80" colorClass = "text-emerald-500/80";
if (style === "basic") { if (style === "basic") {
statusText = t("ping.up") statusText = t("ping.up");
} else { } else {
statusText = ping statusText = ping;
colorClass += " lowercase" colorClass += " lowercase";
} }
} }
if (style === "dot") { if (style === "dot") {
backgroundClass = 'p-3'; backgroundClass = 'p-3';
colorClass = colorClass.replace('text-', 'bg-').replace(/\/\d\d$/, ''); colorClass = colorClass.replace('text-', 'bg-').replace(/\/\d\d/, '');
} }
return ( return (

Loading…
Cancel
Save