fix(monitors): handle initializing and breached states in stat box
This commit is contained in:
1 parent
b482e871a3
commit
58532d1ff6
1 file changed
+9
-4
@@ -42,6 +42,11 @@ export const MonitorStatBoxes = ({
|
||||
const streakTime = prettyMilliseconds(timeSinceLastFailure, options);
|
||||
|
||||
const lastCheckTime = prettyMilliseconds(timeSinceLastCheck, options);
|
||||
const isActive =
|
||||
monitor?.status === "up" ||
|
||||
monitor?.status === "paused" ||
|
||||
monitor?.status === "initializing" ||
|
||||
monitor?.status === "breached";
|
||||
const palette = getStatusPalette(monitor?.status);
|
||||
|
||||
return (
|
||||
@@ -52,11 +57,11 @@ export const MonitorStatBoxes = ({
|
||||
<StatBox
|
||||
palette={palette}
|
||||
title={
|
||||
monitor?.status === "down"
|
||||
? t("pages.common.monitors.statBoxes.serviceIsDown")
|
||||
: t("pages.common.monitors.statBoxes.activeFor")
|
||||
isActive
|
||||
? t("pages.common.monitors.statBoxes.activeFor")
|
||||
: t("pages.common.monitors.statBoxes.serviceIsDown")
|
||||
}
|
||||
subtitle={monitor?.status === "down" ? "" : streakTime}
|
||||
subtitle={isActive ? streakTime : ""}
|
||||
/>
|
||||
<StatBox
|
||||
title={t("pages.common.monitors.statBoxes.lastCheck")}
|
||||
|
||||
Reference in new issue
Block a user