refactor to use monitor-stats
This commit is contained in:
1 parent
6481b1d9ac
commit
37958d7307
2 files changed
+7
-2
No files matched your search
+1
-1
@@ -75,7 +75,7 @@ CustomToolTip.propTypes = {
|
|||||||
PropTypes.shape({
|
PropTypes.shape({
|
||||||
value: PropTypes.number,
|
value: PropTypes.number,
|
||||||
payload: PropTypes.shape({
|
payload: PropTypes.shape({
|
||||||
_id: PropTypes.string,
|
_id: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
|
||||||
avgResponseTime: PropTypes.number,
|
avgResponseTime: PropTypes.number,
|
||||||
originalAvgResponseTime: PropTypes.number,
|
originalAvgResponseTime: PropTypes.number,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -9,6 +9,11 @@ import PropTypes from "prop-types";
|
|||||||
|
|
||||||
const StatBoxes = ({ monitor, lastUpdateTrigger }) => {
|
const StatBoxes = ({ monitor, lastUpdateTrigger }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
let timeSinceLastCheck = 0;
|
||||||
|
|
||||||
|
if (monitor?.lastCheckTimestamp) {
|
||||||
|
timeSinceLastCheck = Date.now() - monitor?.lastCheckTimestamp;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
@@ -32,7 +37,7 @@ const StatBoxes = ({ monitor, lastUpdateTrigger }) => {
|
|||||||
heading={"Last check"}
|
heading={"Last check"}
|
||||||
subHeading={
|
subHeading={
|
||||||
<LastUpdate
|
<LastUpdate
|
||||||
lastUpdateTime={monitor?.timeSinceLastCheck ?? 0}
|
lastUpdateTime={timeSinceLastCheck}
|
||||||
suffix={"seconds ago"}
|
suffix={"seconds ago"}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user