Added monitor interval check
This commit is contained in:
1 parent
78914c9566
commit
5bab1514fc
1 file changed
+49
-4
@@ -13,7 +13,11 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
} from "recharts";
|
} from "recharts";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { formatDateWithTz } from "../../Utils/timeUtils";
|
import {
|
||||||
|
formatDateWithTz,
|
||||||
|
formatDurationRounded,
|
||||||
|
formatDurationSplit,
|
||||||
|
} from "../../Utils/timeUtils";
|
||||||
import useUtils from "../Monitors/utils";
|
import useUtils from "../Monitors/utils";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -128,7 +132,7 @@ const PagespeedAreaChart = ({ data, status }) => {
|
|||||||
const formattedData = processData(data);
|
const formattedData = processData(data);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ResponsiveContainer width="100%" minWidth={25} height={100}>
|
<ResponsiveContainer width="100%" minWidth={25} height={85}>
|
||||||
<AreaChart
|
<AreaChart
|
||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
@@ -210,6 +214,7 @@ const Card = ({ monitor }) => {
|
|||||||
return (
|
return (
|
||||||
<Grid item lg={6} flexGrow={1}>
|
<Grid item lg={6} flexGrow={1}>
|
||||||
<Box
|
<Box
|
||||||
|
position="relative"
|
||||||
p={theme.spacing(8)}
|
p={theme.spacing(8)}
|
||||||
onClick={() => navigate(`/pagespeed/${monitor._id}`)}
|
onClick={() => navigate(`/pagespeed/${monitor._id}`)}
|
||||||
border={1}
|
border={1}
|
||||||
@@ -230,7 +235,12 @@ const Card = ({ monitor }) => {
|
|||||||
<IconBox>
|
<IconBox>
|
||||||
<PageSpeedIcon />
|
<PageSpeedIcon />
|
||||||
</IconBox>
|
</IconBox>
|
||||||
<Typography component="h2" variant="h2" alignSelf="center">
|
<Typography
|
||||||
|
component="h2"
|
||||||
|
variant="h2"
|
||||||
|
fontWeight={500}
|
||||||
|
alignSelf="center"
|
||||||
|
>
|
||||||
{monitor.name}
|
{monitor.name}
|
||||||
</Typography>
|
</Typography>
|
||||||
<StatusLabel
|
<StatusLabel
|
||||||
@@ -245,7 +255,7 @@ const Card = ({ monitor }) => {
|
|||||||
/>
|
/>
|
||||||
<Typography
|
<Typography
|
||||||
variant="body2"
|
variant="body2"
|
||||||
mt={theme.spacing(-1)}
|
mt={theme.spacing(-2)}
|
||||||
sx={{ gridColumnStart: 2 }}
|
sx={{ gridColumnStart: 2 }}
|
||||||
>
|
>
|
||||||
{monitor.url}
|
{monitor.url}
|
||||||
@@ -258,6 +268,41 @@ const Card = ({ monitor }) => {
|
|||||||
>
|
>
|
||||||
<PagespeedAreaChart data={monitor.checks} status={monitorState} />
|
<PagespeedAreaChart data={monitor.checks} status={monitorState} />
|
||||||
</Box>
|
</Box>
|
||||||
|
<Box
|
||||||
|
position="absolute"
|
||||||
|
bottom={0}
|
||||||
|
py={theme.spacing(1)}
|
||||||
|
px={theme.spacing(4)}
|
||||||
|
borderTop={1}
|
||||||
|
borderRight={1}
|
||||||
|
borderColor={theme.palette.border.light}
|
||||||
|
backgroundColor={theme.palette.background.accent}
|
||||||
|
sx={{
|
||||||
|
pointerEvents: "none",
|
||||||
|
userSelect: "none",
|
||||||
|
borderTopRightRadius: 8,
|
||||||
|
borderBottomLeftRadius: 4,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Typography fontSize={11} color={theme.palette.text.accent}>
|
||||||
|
Checking every{" "}
|
||||||
|
{(() => {
|
||||||
|
const { time, format } = formatDurationSplit(monitor?.interval);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Typography
|
||||||
|
component="span"
|
||||||
|
fontSize={12}
|
||||||
|
color={theme.palette.text.primary}
|
||||||
|
>
|
||||||
|
{time}{" "}
|
||||||
|
</Typography>
|
||||||
|
{format}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
})()}
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</Grid>
|
</Grid>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user