dispaly uptime percentage on status pages
This commit is contained in:
1 parent
19b873ca87
commit
eeac784922
1 file changed
+8
@@ -27,6 +27,7 @@ import {
|
|||||||
statusBadgeKey,
|
statusBadgeKey,
|
||||||
} from "@/Pages/StatusPage/Status/themes/shared/overallStatus";
|
} from "@/Pages/StatusPage/Status/themes/shared/overallStatus";
|
||||||
import { useStatusPageTheme } from "@/Pages/StatusPage/Status/themes/StatusPageThemeProvider";
|
import { useStatusPageTheme } from "@/Pages/StatusPage/Status/themes/StatusPageThemeProvider";
|
||||||
|
import { formatPercentage } from "@/Utils/FormatUtils";
|
||||||
|
|
||||||
type StatusPageMonitor = Monitor & { checks?: Monitor["recentChecks"] };
|
type StatusPageMonitor = Monitor & { checks?: Monitor["recentChecks"] };
|
||||||
|
|
||||||
@@ -161,6 +162,7 @@ export const BaseStatusPage = ({ statusPage, monitors, config }: Props) => {
|
|||||||
const showInfra = isHardware && statusPage.showInfrastructure !== false;
|
const showInfra = isHardware && statusPage.showInfrastructure !== false;
|
||||||
const showChart = !isHardware && statusPage.showCharts !== false;
|
const showChart = !isHardware && statusPage.showCharts !== false;
|
||||||
const badgeTone = monitorBadgeTone(monitor.status);
|
const badgeTone = monitorBadgeTone(monitor.status);
|
||||||
|
const uptimePercentage = formatPercentage(monitor.uptimePercentage ?? 0);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
@@ -178,6 +180,12 @@ export const BaseStatusPage = ({ statusPage, monitors, config }: Props) => {
|
|||||||
>
|
>
|
||||||
{getMonitorTypeLabel(monitor.type, t)}
|
{getMonitorTypeLabel(monitor.type, t)}
|
||||||
</Box>
|
</Box>
|
||||||
|
<Box
|
||||||
|
component="span"
|
||||||
|
sx={styles.pill}
|
||||||
|
>
|
||||||
|
{uptimePercentage}
|
||||||
|
</Box>
|
||||||
{monitor.url && (
|
{monitor.url && (
|
||||||
<Box
|
<Box
|
||||||
component="span"
|
component="span"
|
||||||
|
|||||||
Reference in new issue
Block a user