Add last checked
This commit is contained in:
1 parent
f176768b54
commit
180585806b
1 file changed
+5
-4
@@ -206,7 +206,7 @@ const InfrastructureDetails = () => {
|
|||||||
];
|
];
|
||||||
const [monitor, setMonitor] = useState(null);
|
const [monitor, setMonitor] = useState(null);
|
||||||
const { authToken } = useSelector((state) => state.auth);
|
const { authToken } = useSelector((state) => state.auth);
|
||||||
const [dateRange, setDateRange] = useState("all");
|
const [dateRange, setDateRange] = useState("day");
|
||||||
const { statusColor, statusStyles, determineState } = useUtils();
|
const { statusColor, statusStyles, determineState } = useUtils();
|
||||||
// These calculations are needed because ResponsiveContainer
|
// These calculations are needed because ResponsiveContainer
|
||||||
// doesn't take padding of parent/siblings into account
|
// doesn't take padding of parent/siblings into account
|
||||||
@@ -514,7 +514,8 @@ const InfrastructureDetails = () => {
|
|||||||
);
|
);
|
||||||
const gaugeBoxConfigs = buildGaugeBoxConfigs(monitor?.stats ?? {});
|
const gaugeBoxConfigs = buildGaugeBoxConfigs(monitor?.stats ?? {});
|
||||||
const areaChartConfigs = buildAreaChartConfigs(monitor?.stats?.checks ?? []);
|
const areaChartConfigs = buildAreaChartConfigs(monitor?.stats?.checks ?? []);
|
||||||
|
const lastChecked =
|
||||||
|
Date.now() - new Date(monitor?.stats?.aggregateData?.latestCheck?.createdAt);
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Breadcrumbs list={navList} />
|
<Breadcrumbs list={navList} />
|
||||||
@@ -544,8 +545,8 @@ const InfrastructureDetails = () => {
|
|||||||
Checking every {formatDurationRounded(monitor?.interval)}
|
Checking every {formatDurationRounded(monitor?.interval)}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography alignSelf="end">
|
<Typography alignSelf="end">
|
||||||
Last checked {formatDurationSplit(monitor?.lastChecked).time}{" "}
|
Last checked {formatDurationSplit(lastChecked).time}{" "}
|
||||||
{formatDurationSplit(monitor?.lastChecked).format} ago
|
{formatDurationSplit(lastChecked).format} ago
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user