Files
Checkmate/src/Pages/DistributedUptime/Details/Components/StatBoxes/index.jsx
T

60 lines
1.2 KiB
React
Raw Normal View History

2025-02-06 16:07:57 -08:00
// Components
import { Stack } from "@mui/material";
2025-02-20 19:02:24 -08:00
import InfoBox from "../../../../../Components/InfoBox";
2025-02-06 16:07:57 -08:00
import LastUpdate from "../LastUpdate";
// Utils
import { useTheme } from "@mui/material/styles";
import PropTypes from "prop-types";
const StatBoxes = ({ monitor, lastUpdateTrigger }) => {
const theme = useTheme();
return (
<Stack
direction="row"
2025-02-20 19:02:24 -08:00
justifyContent="space-between"
2025-02-26 11:41:36 -08:00
flexWrap="wrap"
2025-02-06 16:07:57 -08:00
gap={theme.spacing(8)}
>
2025-02-20 19:02:24 -08:00
<InfoBox
sx={{ flex: 1 }}
2025-02-06 16:07:57 -08:00
heading="Avg Response Time"
subHeading={`${Math.floor(monitor?.avgResponseTime ?? 0)} ms`}
/>
2025-02-20 19:02:24 -08:00
<InfoBox
sx={{ flex: 1 }}
2025-02-06 16:07:57 -08:00
heading="Checking every"
subHeading={`${(monitor?.interval ?? 0) / 1000} seconds`}
/>
2025-02-20 19:02:24 -08:00
<InfoBox
sx={{ flex: 1 }}
2025-02-06 16:07:57 -08:00
heading={"Last check"}
subHeading={
<LastUpdate
2025-03-07 11:14:40 -08:00
lastUpdateTime={monitor?.timeSinceLastCheck}
2025-02-06 16:07:57 -08:00
suffix={"seconds ago"}
/>
}
/>
2025-02-20 19:02:24 -08:00
<InfoBox
sx={{ flex: 1 }}
2025-02-06 16:07:57 -08:00
heading="Last server push"
subHeading={
<LastUpdate
suffix={"seconds ago"}
lastUpdateTime={0}
trigger={lastUpdateTrigger}
/>
}
/>
</Stack>
);
};
StatBoxes.propTypes = {
monitor: PropTypes.object,
lastUpdateTrigger: PropTypes.number,
};
export default StatBoxes;