Fixed get last checked function (#489)

* Fixed get last checked function

* Updated docs
This commit is contained in:
Daniel C
2024-07-30 15:44:41 -04:00
committed by GitHub
parent 05574a08ac
commit 960afd44f9
2 changed files with 10 additions and 8 deletions

View File

@@ -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);

View File

@@ -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:{" "}