mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-19 02:59:50 +00:00
Include tailwind bg-black/white, greedy ping regex, adjust position
This commit is contained in:
parent
b765330b4a
commit
4f41be512c
5 changed files with 12 additions and 9 deletions
|
@ -7,7 +7,7 @@ export default function Ping({ group, service, style }) {
|
|||
refreshInterval: 30000
|
||||
});
|
||||
|
||||
let colorClass = "text-black/20 dark:text-white/40";
|
||||
let colorClass = "text-black/20 dark:text-white/40 opacity-20";
|
||||
let backgroundClass = "bg-theme-500/10 dark:bg-theme-900/50 px-1.5 py-0.5";
|
||||
let statusTitle = t("ping.http_status");
|
||||
let statusText = "";
|
||||
|
@ -28,7 +28,7 @@ export default function Ping({ group, service, style }) {
|
|||
} else {
|
||||
statusText = data.status;
|
||||
}
|
||||
} else {
|
||||
} else if (data) {
|
||||
const ping = t("common.ms", { value: data.latency, style: "unit", unit: "millisecond", maximumFractionDigits: 0 })
|
||||
statusTitle += ` ${data.status} (${ping})`;
|
||||
colorClass = "text-emerald-500/80";
|
||||
|
@ -42,8 +42,8 @@ export default function Ping({ group, service, style }) {
|
|||
}
|
||||
|
||||
if (style === "dot") {
|
||||
backgroundClass = 'p-3';
|
||||
colorClass = colorClass.replace('text-', 'bg-').replace(/\/\d\d/, '');
|
||||
backgroundClass = 'p-4';
|
||||
colorClass = colorClass.replace(/text-/g, 'bg-').replace(/\/\d\d/g, '');
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue