Merge pull request #1890 from bluewave-labs/fix/vars

fix: vars
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-03-07 11:27:18 -08:00
commit 483699e2b7
2 files changed
+3 -8

No files matched your search

@@ -9,11 +9,6 @@ import PropTypes from "prop-types";
const StatBoxes = ({ monitor, lastUpdateTrigger }) => {
const theme = useTheme();
let timeSinceLastCheck = 0;
if (monitor?.lastCheckTimestamp) {
timeSinceLastCheck = Date.now() - monitor?.lastCheckTimestamp;
}
return (
<Stack
@@ -37,7 +32,7 @@ const StatBoxes = ({ monitor, lastUpdateTrigger }) => {
heading={"Last check"}
subHeading={
<LastUpdate
lastUpdateTime={timeSinceLastCheck}
lastUpdateTime={monitor?.timeSinceLastCheck}
suffix={"seconds ago"}
/>
}
@@ -59,7 +59,7 @@ const StatusHeader = ({ monitor, connectionStatus, elementToCapture }) => {
backgroundColor={theme.palette.successSecondary.lowContrast}
color={theme.palette.success.lowContrast}
>
Uptime: {(monitor.totalUptime * 100).toFixed(2)}%
Uptime: {(monitor.uptimePercentage * 100).toFixed(2)}%
</Typography>
</Stack>
<Typography
@@ -69,7 +69,7 @@ const StatusHeader = ({ monitor, connectionStatus, elementToCapture }) => {
Last updated{" "}
<LastUpdate
suffix={"seconds ago"}
lastUpdateTime={monitor.timeSinceLastCheck}
lastUpdateTime={monitor?.timeSinceLastCheck}
/>
</Typography>
</Stack>