Add indeterminate state to monitors

This commit is contained in:
Alex Holliday committed 2024-09-02 10:45:07 -07:00
1 parent aa81e47fae
commit 071a7fc9cf
7 files changed
+60 -33

No files matched your search

+2 -1
View File
@@ -53,7 +53,8 @@ Host.propTypes = {
params: PropTypes.shape({
title: PropTypes.string,
percentageColor: PropTypes.string,
percentage: PropTypes.number,
percentage: PropTypes.string,
url: PropTypes.string,
}).isRequired,
};
@@ -35,8 +35,8 @@ export const buildData = (monitors, isAdmin, navigate) => {
if (monitor.uptimePercentage !== undefined) {
uptimePercentage =
monitor.uptimePercentage === 0
? "0"
: (monitor.uptimePercentage * 100).toFixed(2);
? "0"
: (monitor.uptimePercentage * 100).toFixed(2);
}
const params = {
@@ -47,7 +47,12 @@ export const buildData = (monitors, isAdmin, navigate) => {
monitor.status === true
? theme.palette.success.main
: theme.palette.error.text,
status: monitor.status === true ? "up" : "down",
status:
monitor.status === undefined
? "unknown"
: monitor.status === true
? "up"
: "down",
};
// Reverse checks so latest check is on the right
@@ -86,6 +91,3 @@ export const buildData = (monitors, isAdmin, navigate) => {
});
return data;
};