mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-15 14:19:41 -06:00
Fixed get last checked function (#489)
* Fixed get last checked function * Updated docs
This commit is contained in:
@@ -13,10 +13,13 @@
|
||||
font-size: var(--env-var-font-size-large);
|
||||
font-weight: 600;
|
||||
}
|
||||
.page-speed span.MuiTypography-root,
|
||||
.page-speed p.MuiTypography-root {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
}
|
||||
.page-speed p:has(> span.MuiTypography-root),
|
||||
.page-speed p.MuiTypography-root > span.MuiTypography-root {
|
||||
font-size: var(--env-var-font-size-small-plus);
|
||||
}
|
||||
.page-speed .MuiGrid-item > .MuiStack-root {
|
||||
border: solid 1px var(--env-var-color-6);
|
||||
border-radius: var(--env-var-radius-1);
|
||||
|
||||
@@ -23,11 +23,11 @@ const Card = ({ data }) => {
|
||||
return 0; // Handle case when no checks are available
|
||||
}
|
||||
|
||||
// Data is sorted oldest -> newest, so last check is the most recent
|
||||
// Data is sorted newest -> oldest, so newest check is the most recent
|
||||
if (!duration) {
|
||||
return new Date(checks[checks.length - 1].createdAt);
|
||||
return new Date(checks[0].createdAt);
|
||||
}
|
||||
return new Date() - new Date(checks[checks.length - 1].createdAt);
|
||||
return new Date() - new Date(checks[0].createdAt);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -39,13 +39,12 @@ const Card = ({ data }) => {
|
||||
<Typography component="h2" mb={theme.gap.xs}>
|
||||
{data.name}
|
||||
</Typography>
|
||||
{/* TODO - fix prop-type error */}
|
||||
<StatusLabel
|
||||
status={data.isActive ? "up" : "cannot resolve"}
|
||||
text={data.isActive ? "Live (collecting data)" : "Inactive"}
|
||||
status={data.status ? "up" : "cannot resolve"}
|
||||
text={data.status ? "Live (collecting data)" : "Inactive"}
|
||||
/>
|
||||
</Stack>
|
||||
<Typography>{data.url}</Typography>
|
||||
<Typography>{data.url.replace(/^https?:\/\//, "")}</Typography>
|
||||
<Typography mt={theme.gap.large}>
|
||||
<Typography component="span" fontWeight={600}>
|
||||
Last checked:{" "}
|
||||
|
||||
Reference in New Issue
Block a user