Fixed get last checked function (#489)
* Fixed get last checked function * Updated docs
This commit is contained in:
1 parent
05574a08ac
commit
960afd44f9
2 files changed
+10
-8
No files matched your search
@@ -13,10 +13,13 @@
|
|||||||
font-size: var(--env-var-font-size-large);
|
font-size: var(--env-var-font-size-large);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.page-speed span.MuiTypography-root,
|
|
||||||
.page-speed p.MuiTypography-root {
|
.page-speed p.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-medium);
|
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 {
|
.page-speed .MuiGrid-item > .MuiStack-root {
|
||||||
border: solid 1px var(--env-var-color-6);
|
border: solid 1px var(--env-var-color-6);
|
||||||
border-radius: var(--env-var-radius-1);
|
border-radius: var(--env-var-radius-1);
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ const Card = ({ data }) => {
|
|||||||
return 0; // Handle case when no checks are available
|
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) {
|
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 (
|
return (
|
||||||
@@ -39,13 +39,12 @@ const Card = ({ data }) => {
|
|||||||
<Typography component="h2" mb={theme.gap.xs}>
|
<Typography component="h2" mb={theme.gap.xs}>
|
||||||
{data.name}
|
{data.name}
|
||||||
</Typography>
|
</Typography>
|
||||||
{/* TODO - fix prop-type error */}
|
|
||||||
<StatusLabel
|
<StatusLabel
|
||||||
status={data.isActive ? "up" : "cannot resolve"}
|
status={data.status ? "up" : "cannot resolve"}
|
||||||
text={data.isActive ? "Live (collecting data)" : "Inactive"}
|
text={data.status ? "Live (collecting data)" : "Inactive"}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Typography>{data.url}</Typography>
|
<Typography>{data.url.replace(/^https?:\/\//, "")}</Typography>
|
||||||
<Typography mt={theme.gap.large}>
|
<Typography mt={theme.gap.large}>
|
||||||
<Typography component="span" fontWeight={600}>
|
<Typography component="span" fontWeight={600}>
|
||||||
Last checked:{" "}
|
Last checked:{" "}
|
||||||
|
|||||||
Reference in new issue
Block a user