Refactored pages styling 3/3
This commit is contained in:
1 parent
bd1d1d8082
commit
a4c5dd3ee7
23 files changed
+611
-577
No files matched your search
@@ -1,52 +1,17 @@
|
|||||||
.configure-monitor h1.MuiTypography-root {
|
.configure-monitor h1.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large-plus);
|
font-size: var(--env-var-font-size-large-plus);
|
||||||
color: var(--primary-color);
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.configure-monitor h2.MuiTypography-root {
|
.configure-monitor p.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.configure-monitor h2.MuiTypography-root,
|
|
||||||
.configure-monitor .config-box p.MuiTypography-root,
|
|
||||||
.configure-monitor .MuiSelect-select {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.configure-monitor .MuiModal-root h2.MuiTypography-root {
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
.configure-monitor p.MuiTypography-root,
|
|
||||||
.configure-monitor .MuiSelect-select {
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
font-size: var(--env-var-font-size-medium);
|
||||||
}
|
}
|
||||||
.configure-monitor h6.MuiTypography-root {
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
.configure-monitor h6.MuiTypography-root,
|
|
||||||
.configure-monitor h1.MuiTypography-root + span.MuiTypography-root {
|
.configure-monitor h1.MuiTypography-root + span.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-small-plus);
|
font-size: var(--env-var-font-size-small-plus);
|
||||||
}
|
}
|
||||||
.configure-monitor button.MuiButtonBase-root {
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
|
||||||
}
|
|
||||||
.configure-monitor button.MuiButtonBase-root {
|
.configure-monitor button.MuiButtonBase-root {
|
||||||
height: var(--env-var-height-2);
|
height: var(--env-var-height-2);
|
||||||
}
|
}
|
||||||
.configure-monitor .config-box {
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
}
|
|
||||||
.configure-monitor .config-box > .MuiBox-root,
|
|
||||||
.configure-monitor .config-box > .MuiStack-root {
|
|
||||||
flex: 1;
|
|
||||||
padding: 24px 30px;
|
|
||||||
padding-bottom: 40px;
|
|
||||||
}
|
|
||||||
.configure-monitor .config-box > *:first-child {
|
|
||||||
flex: 0.7;
|
|
||||||
border-right: solid 1px var(--border-color);
|
|
||||||
}
|
|
||||||
.configure-monitor .MuiStack-root:has(span.MuiTypography-root.input-error) {
|
.configure-monitor .MuiStack-root:has(span.MuiTypography-root.input-error) {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@@ -54,25 +19,3 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
}
|
}
|
||||||
.configure-monitor .MuiInputBase-root:has(> .Mui-disabled) {
|
|
||||||
background-color: var(--primary-bg-accent);
|
|
||||||
}
|
|
||||||
|
|
||||||
.MuiInputBase-root:has(#monitor-interval) {
|
|
||||||
height: 34px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
#monitor-interval {
|
|
||||||
padding: 0 10px;
|
|
||||||
height: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.MuiInputBase-root:not(.Mui-focused):has(#monitor-interval):hover fieldset {
|
|
||||||
border-color: var(--border-color-dark);
|
|
||||||
}
|
|
||||||
|
|
||||||
body:has(.configure-monitor) .select-dropdown .MuiMenuItem-root,
|
|
||||||
.configure-monitor .select-wrapper .select-component > .MuiSelect-select {
|
|
||||||
text-transform: lowercase;
|
|
||||||
}
|
|
||||||
@@ -6,6 +6,7 @@ import { Box, Modal, Skeleton, Stack, Typography } from "@mui/material";
|
|||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
import { logger } from "../../../Utils/Logger";
|
import { logger } from "../../../Utils/Logger";
|
||||||
|
import { ConfigBox } from "../styled";
|
||||||
import {
|
import {
|
||||||
updateUptimeMonitor,
|
updateUptimeMonitor,
|
||||||
getUptimeMonitorsByTeamId,
|
getUptimeMonitorsByTeamId,
|
||||||
@@ -45,8 +46,8 @@ const SkeletonLayout = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Skeleton variant="rounded" width="15%" height={34} />
|
<Skeleton variant="rounded" width="15%" height={34} />
|
||||||
<Stack gap={theme.gap.xl} mt={theme.gap.medium}>
|
<Stack gap={theme.spacing(20)} mt={theme.spacing(6)}>
|
||||||
<Stack direction="row" gap={theme.gap.small} mt={theme.gap.small}>
|
<Stack direction="row" gap={theme.spacing(4)} mt={theme.spacing(4)}>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
variant="circular"
|
variant="circular"
|
||||||
style={{ minWidth: 24, minHeight: 24 }}
|
style={{ minWidth: 24, minHeight: 24 }}
|
||||||
@@ -56,13 +57,13 @@ const SkeletonLayout = () => {
|
|||||||
variant="rounded"
|
variant="rounded"
|
||||||
width="50%"
|
width="50%"
|
||||||
height={24}
|
height={24}
|
||||||
sx={{ mb: theme.gap.small }}
|
sx={{ mb: theme.spacing(4) }}
|
||||||
/>
|
/>
|
||||||
<Skeleton variant="rounded" width="50%" height={18} />
|
<Skeleton variant="rounded" width="50%" height={18} />
|
||||||
</Box>
|
</Box>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.gap.medium}
|
gap={theme.spacing(6)}
|
||||||
sx={{
|
sx={{
|
||||||
ml: "auto",
|
ml: "auto",
|
||||||
alignSelf: "flex-end",
|
alignSelf: "flex-end",
|
||||||
@@ -209,7 +210,7 @@ const Configure = () => {
|
|||||||
let loading = Object.keys(monitor).length === 0;
|
let loading = Object.keys(monitor).length === 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="configure-monitor" gap={theme.gap.large}>
|
<Stack className="configure-monitor" gap={theme.spacing(12)}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<SkeletonLayout />
|
<SkeletonLayout />
|
||||||
) : (
|
) : (
|
||||||
@@ -225,20 +226,25 @@ const Configure = () => {
|
|||||||
component="form"
|
component="form"
|
||||||
noValidate
|
noValidate
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
flex={1}
|
flex={1}
|
||||||
>
|
>
|
||||||
<Stack direction="row" gap={theme.gap.xs}>
|
<Stack direction="row" gap={theme.spacing(2)}>
|
||||||
<PulseDot
|
<PulseDot
|
||||||
color={
|
color={
|
||||||
monitor?.status
|
monitor?.status
|
||||||
? theme.label.up.dotColor
|
? theme.palette.success.main
|
||||||
: theme.label.down.dotColor
|
: theme.palette.error.main
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Box>
|
<Box>
|
||||||
{parsedUrl?.host ? (
|
{parsedUrl?.host ? (
|
||||||
<Typography component="h1" mb={theme.gap.xs} lineHeight={1}>
|
<Typography
|
||||||
|
component="h1"
|
||||||
|
mb={theme.spacing(2)}
|
||||||
|
lineHeight={1}
|
||||||
|
color={theme.palette.text.primary}
|
||||||
|
>
|
||||||
{parsedUrl.host || "..."}
|
{parsedUrl.host || "..."}
|
||||||
</Typography>
|
</Typography>
|
||||||
) : (
|
) : (
|
||||||
@@ -246,11 +252,11 @@ const Configure = () => {
|
|||||||
)}
|
)}
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
lineHeight={theme.gap.large}
|
lineHeight={theme.spacing(12)}
|
||||||
sx={{
|
sx={{
|
||||||
color: monitor?.status
|
color: monitor?.status
|
||||||
? "var(--success-color)"
|
? theme.palette.success.main
|
||||||
: "var(--error-color)",
|
: theme.palette.error.text,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Your site is {monitor?.status ? "up" : "down"}.
|
Your site is {monitor?.status ? "up" : "down"}.
|
||||||
@@ -268,12 +274,12 @@ const Configure = () => {
|
|||||||
animate="rotate180"
|
animate="rotate180"
|
||||||
img={<PauseCircleOutlineIcon />}
|
img={<PauseCircleOutlineIcon />}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: theme.palette.otherColors.fillGray,
|
backgroundColor: theme.palette.background.main,
|
||||||
pl: theme.gap.small,
|
pl: theme.spacing(4),
|
||||||
pr: theme.gap.medium,
|
pr: theme.spacing(6),
|
||||||
mr: theme.gap.medium,
|
mr: theme.spacing(6),
|
||||||
"& svg": {
|
"& svg": {
|
||||||
mr: theme.gap.xs,
|
mr: theme.spacing(2),
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -282,25 +288,21 @@ const Configure = () => {
|
|||||||
label="Remove"
|
label="Remove"
|
||||||
sx={{
|
sx={{
|
||||||
boxShadow: "none",
|
boxShadow: "none",
|
||||||
px: theme.gap.ml,
|
px: theme.spacing(8),
|
||||||
}}
|
}}
|
||||||
onClick={() => setIsOpen(true)}
|
onClick={() => setIsOpen(true)}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<ConfigBox>
|
||||||
className="config-box"
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
>
|
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">General settings</Typography>
|
<Typography component="h2">General settings</Typography>
|
||||||
<Typography component="p" sx={{ mt: theme.gap.xs }}>
|
<Typography component="p">
|
||||||
Here you can select the URL of the host, together with the
|
Here you can select the URL of the host, together with the
|
||||||
type of monitor.
|
type of monitor.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.gap.xl}>
|
<Stack gap={theme.spacing(20)}>
|
||||||
<Field
|
<Field
|
||||||
type={monitor?.type === "http" ? "url" : "text"}
|
type={monitor?.type === "http" ? "url" : "text"}
|
||||||
https={protocol === "https"}
|
https={protocol === "https"}
|
||||||
@@ -322,20 +324,16 @@ const Configure = () => {
|
|||||||
error={errors["name"]}
|
error={errors["name"]}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
<Stack
|
<ConfigBox>
|
||||||
className="config-box"
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
>
|
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">Incident notifications</Typography>
|
<Typography component="h2">Incident notifications</Typography>
|
||||||
<Typography component="p" mt={theme.gap.xs}>
|
<Typography component="p">
|
||||||
When there is an incident, notify users.
|
When there is an incident, notify users.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.gap.medium}>
|
<Stack gap={theme.spacing(6)}>
|
||||||
<Typography component="p" mt={theme.gap.small}>
|
<Typography component="p">
|
||||||
When there is a new incident,
|
When there is a new incident,
|
||||||
</Typography>
|
</Typography>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -368,7 +366,7 @@ const Configure = () => {
|
|||||||
{monitor?.notifications?.some(
|
{monitor?.notifications?.some(
|
||||||
(notification) => notification.type === "emails"
|
(notification) => notification.type === "emails"
|
||||||
) ? (
|
) ? (
|
||||||
<Box mx={`calc(${theme.gap.ml} * 2)`}>
|
<Box mx={theme.spacing(16)}>
|
||||||
<Field
|
<Field
|
||||||
id="notify-email-list"
|
id="notify-email-list"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -376,7 +374,7 @@ const Configure = () => {
|
|||||||
value=""
|
value=""
|
||||||
onChange={() => logger.warn("disabled")}
|
onChange={() => logger.warn("disabled")}
|
||||||
/>
|
/>
|
||||||
<Typography mt={theme.gap.small}>
|
<Typography mt={theme.spacing(4)}>
|
||||||
You can separate multiple emails with a comma
|
You can separate multiple emails with a comma
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -384,16 +382,12 @@ const Configure = () => {
|
|||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
<Stack
|
<ConfigBox>
|
||||||
className="config-box"
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
>
|
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">Advanced settings</Typography>
|
<Typography component="h2">Advanced settings</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.gap.xl}>
|
<Stack gap={theme.spacing(20)}>
|
||||||
<Select
|
<Select
|
||||||
id="monitor-interval-configure"
|
id="monitor-interval-configure"
|
||||||
label="Check frequency"
|
label="Check frequency"
|
||||||
@@ -402,12 +396,12 @@ const Configure = () => {
|
|||||||
items={frequencies}
|
items={frequencies}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
<Stack direction="row" justifyContent="flex-end" mt="auto">
|
<Stack direction="row" justifyContent="flex-end" mt="auto">
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
level="primary"
|
||||||
label="Save"
|
label="Save"
|
||||||
sx={{ px: theme.gap.large }}
|
sx={{ px: theme.spacing(12) }}
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -422,33 +416,43 @@ const Configure = () => {
|
|||||||
disablePortal
|
disablePortal
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
gap={theme.gap.xs}
|
gap={theme.spacing(2)}
|
||||||
sx={{
|
sx={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
top: "50%",
|
top: "50%",
|
||||||
left: "50%",
|
left: "50%",
|
||||||
transform: "translate(-50%, -50%)",
|
transform: "translate(-50%, -50%)",
|
||||||
width: 400,
|
width: 400,
|
||||||
bgcolor: "white",
|
bgcolor: theme.palette.background.main,
|
||||||
border: "solid 1px #f2f2f2",
|
border: 1,
|
||||||
borderRadius: `${theme.shape.borderRadius}px`,
|
borderColor: theme.palette.border.light,
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
boxShadow: 24,
|
boxShadow: 24,
|
||||||
p: "30px",
|
p: theme.spacing(15),
|
||||||
"&:focus": {
|
"&:focus": {
|
||||||
outline: "none",
|
outline: "none",
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography id="modal-delete-monitor" component="h2">
|
<Typography
|
||||||
|
id="modal-delete-monitor"
|
||||||
|
component="h2"
|
||||||
|
fontSize={16}
|
||||||
|
color={theme.palette.text.primary}
|
||||||
|
fontWeight={600}
|
||||||
|
>
|
||||||
Do you really want to delete this monitor?
|
Do you really want to delete this monitor?
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography id="delete-monitor-confirmation">
|
<Typography
|
||||||
|
id="delete-monitor-confirmation"
|
||||||
|
color={theme.palette.text.tertiary}
|
||||||
|
>
|
||||||
Once deleted, this monitor cannot be retrieved.
|
Once deleted, this monitor cannot be retrieved.
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.gap.small}
|
gap={theme.spacing(4)}
|
||||||
mt={theme.gap.large}
|
mt={theme.spacing(12)}
|
||||||
justifyContent="flex-end"
|
justifyContent="flex-end"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -1,23 +1,11 @@
|
|||||||
.create-monitor h1.MuiTypography-root {
|
.create-monitor h1.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large-plus);
|
font-size: var(--env-var-font-size-large-plus);
|
||||||
color: var(--primary-color);
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
.create-monitor h2.MuiTypography-root {
|
|
||||||
font-size: var(--env-var-font-size-large);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.create-monitor p.MuiTypography-root,
|
.create-monitor p.MuiTypography-root,
|
||||||
.create-monitor button.MuiButtonBase-root {
|
.create-monitor button.MuiButtonBase-root {
|
||||||
font-size: var(--env-var-font-size-medium);
|
font-size: var(--env-var-font-size-medium);
|
||||||
}
|
}
|
||||||
.create-monitor h2.MuiTypography-root {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.create-monitor h6.MuiTypography-root,
|
|
||||||
.create-monitor p.MuiTypography-root {
|
|
||||||
color: var(--secondary-color-light);
|
|
||||||
}
|
|
||||||
.create-monitor h6.MuiTypography-root,
|
.create-monitor h6.MuiTypography-root,
|
||||||
.create-monitor .MuiBox-root .field + p.MuiTypography-root {
|
.create-monitor .MuiBox-root .field + p.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-small-plus);
|
font-size: var(--env-var-font-size-small-plus);
|
||||||
@@ -26,11 +14,11 @@
|
|||||||
.create-monitor button.MuiButtonBase-root {
|
.create-monitor button.MuiButtonBase-root {
|
||||||
height: 34px;
|
height: 34px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.create-monitor .error-container {
|
.create-monitor .error-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
.create-monitor .error-container p.MuiTypography-root.input-error {
|
.create-monitor .error-container p.MuiTypography-root.input-error {
|
||||||
color: var(--error-color);
|
|
||||||
opacity: 0.8;
|
opacity: 0.8;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
@@ -42,30 +30,9 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 100%;
|
top: 100%;
|
||||||
}
|
}
|
||||||
.create-monitor .config-box {
|
|
||||||
flex-direction: row;
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
}
|
|
||||||
.create-monitor .config-box > .MuiBox-root,
|
|
||||||
.create-monitor .config-box > .MuiStack-root {
|
|
||||||
flex: 1;
|
|
||||||
padding: 24px 30px;
|
|
||||||
padding-bottom: 40px;
|
|
||||||
}
|
|
||||||
.create-monitor .config-box > *:first-child {
|
|
||||||
flex: 0.7;
|
|
||||||
border-right: solid 1px var(--border-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-monitor .MuiStack-root .MuiButtonGroup-root button {
|
.create-monitor .MuiStack-root .MuiButtonGroup-root button {
|
||||||
font-size: var(--env-var-font-size-small);
|
font-size: var(--env-var-font-size-small);
|
||||||
height: 28px;
|
height: 28px;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
body:has(.create-monitor) .select-dropdown .MuiMenuItem-root,
|
|
||||||
.create-monitor .select-wrapper .select-component > .MuiSelect-select {
|
|
||||||
text-transform: lowercase;
|
|
||||||
}
|
|
||||||
@@ -1,19 +1,20 @@
|
|||||||
import "./index.css";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import Radio from "../../../Components/Inputs/Radio";
|
|
||||||
import Button from "../../../Components/Button";
|
|
||||||
import { Box, ButtonGroup, Stack, Typography } from "@mui/material";
|
import { Box, ButtonGroup, Stack, Typography } from "@mui/material";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { createUptimeMonitor } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
import { createUptimeMonitor } from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
|
import { logger } from "../../../Utils/Logger";
|
||||||
|
import { ConfigBox } from "../styled";
|
||||||
|
import Radio from "../../../Components/Inputs/Radio";
|
||||||
|
import Button from "../../../Components/Button";
|
||||||
import Field from "../../../Components/Inputs/Field";
|
import Field from "../../../Components/Inputs/Field";
|
||||||
import Select from "../../../Components/Inputs/Select";
|
import Select from "../../../Components/Inputs/Select";
|
||||||
import Checkbox from "../../../Components/Inputs/Checkbox";
|
import Checkbox from "../../../Components/Inputs/Checkbox";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
|
||||||
import Breadcrumbs from "../../../Components/Breadcrumbs";
|
import Breadcrumbs from "../../../Components/Breadcrumbs";
|
||||||
import { logger } from "../../../Utils/Logger";
|
import "./index.css";
|
||||||
|
|
||||||
const CreateMonitor = () => {
|
const CreateMonitor = () => {
|
||||||
const MS_PER_MINUTE = 60000;
|
const MS_PER_MINUTE = 60000;
|
||||||
@@ -33,7 +34,7 @@ const CreateMonitor = () => {
|
|||||||
const [monitor, setMonitor] = useState({
|
const [monitor, setMonitor] = useState({
|
||||||
url: "",
|
url: "",
|
||||||
name: "",
|
name: "",
|
||||||
type: "",
|
type: "http",
|
||||||
notifications: [],
|
notifications: [],
|
||||||
interval: 1,
|
interval: 1,
|
||||||
});
|
});
|
||||||
@@ -144,7 +145,14 @@ const CreateMonitor = () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box className="create-monitor">
|
<Box
|
||||||
|
className="create-monitor"
|
||||||
|
sx={{
|
||||||
|
"& h1": {
|
||||||
|
color: theme.palette.text.primary,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Breadcrumbs
|
<Breadcrumbs
|
||||||
list={[
|
list={[
|
||||||
{ name: "monitors", path: "/monitors" },
|
{ name: "monitors", path: "/monitors" },
|
||||||
@@ -157,14 +165,14 @@ const CreateMonitor = () => {
|
|||||||
onSubmit={handleCreateMonitor}
|
onSubmit={handleCreateMonitor}
|
||||||
noValidate
|
noValidate
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
mt={theme.gap.medium}
|
mt={theme.spacing(6)}
|
||||||
>
|
>
|
||||||
<Typography component="h1">
|
<Typography component="h1">
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
fontSize="inherit"
|
fontSize="inherit"
|
||||||
color={theme.palette.otherColors.bluishGray}
|
color={theme.palette.text.secondary}
|
||||||
>
|
>
|
||||||
Create your{" "}
|
Create your{" "}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -172,15 +180,15 @@ const CreateMonitor = () => {
|
|||||||
monitor
|
monitor
|
||||||
</Typography>
|
</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stack className="config-box">
|
<ConfigBox>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">General settings</Typography>
|
<Typography component="h2">General settings</Typography>
|
||||||
<Typography component="p" mt={theme.gap.xs}>
|
<Typography component="p">
|
||||||
Here you can select the URL of the host, together with the type of
|
Here you can select the URL of the host, together with the type of
|
||||||
monitor.
|
monitor.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.gap.xl}>
|
<Stack gap={theme.spacing(15)}>
|
||||||
<Field
|
<Field
|
||||||
type={monitor.type === "http" ? "url" : "text"}
|
type={monitor.type === "http" ? "url" : "text"}
|
||||||
id="monitor-url"
|
id="monitor-url"
|
||||||
@@ -202,16 +210,16 @@ const CreateMonitor = () => {
|
|||||||
error={errors["name"]}
|
error={errors["name"]}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
<Stack className="config-box">
|
<ConfigBox>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">Checks to perform</Typography>
|
<Typography component="h2">Checks to perform</Typography>
|
||||||
<Typography component="p" mt={theme.gap.xs}>
|
<Typography component="p">
|
||||||
You can always add or remove checks after adding your site.
|
You can always add or remove checks after adding your site.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.gap.large}>
|
<Stack gap={theme.spacing(12)}>
|
||||||
<Stack gap={theme.gap.medium}>
|
<Stack gap={theme.spacing(6)}>
|
||||||
<Radio
|
<Radio
|
||||||
id="monitor-checks-http"
|
id="monitor-checks-http"
|
||||||
title="Website monitoring"
|
title="Website monitoring"
|
||||||
@@ -228,8 +236,7 @@ const CreateMonitor = () => {
|
|||||||
label="HTTPS"
|
label="HTTPS"
|
||||||
onClick={() => setHttps(true)}
|
onClick={() => setHttps(true)}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor:
|
backgroundColor: https && theme.palette.background.fill,
|
||||||
https && theme.palette.otherColors.fillGray,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
@@ -237,8 +244,7 @@ const CreateMonitor = () => {
|
|||||||
label="HTTP"
|
label="HTTP"
|
||||||
onClick={() => setHttps(false)}
|
onClick={() => setHttps(false)}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor:
|
backgroundColor: !https && theme.palette.background.fill,
|
||||||
!https && theme.palette.otherColors.fillGray,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
@@ -257,7 +263,11 @@ const CreateMonitor = () => {
|
|||||||
/>
|
/>
|
||||||
{errors["type"] ? (
|
{errors["type"] ? (
|
||||||
<Box className="error-container">
|
<Box className="error-container">
|
||||||
<Typography component="p" className="input-error">
|
<Typography
|
||||||
|
component="p"
|
||||||
|
className="input-error"
|
||||||
|
color={theme.palette.error.text}
|
||||||
|
>
|
||||||
{errors["type"]}
|
{errors["type"]}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -265,15 +275,15 @@ const CreateMonitor = () => {
|
|||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
<Stack className="config-box">
|
<ConfigBox>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">Incident notifications</Typography>
|
<Typography component="h2">Incident notifications</Typography>
|
||||||
<Typography component="p" mt={theme.gap.xs}>
|
<Typography component="p">
|
||||||
When there is an incident, notify users.
|
When there is an incident, notify users.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.gap.medium}>
|
<Stack gap={theme.spacing(6)}>
|
||||||
<Typography component="p">When there is a new incident,</Typography>
|
<Typography component="p">When there is a new incident,</Typography>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
id="notify-sms"
|
id="notify-sms"
|
||||||
@@ -303,7 +313,7 @@ const CreateMonitor = () => {
|
|||||||
{monitor.notifications.some(
|
{monitor.notifications.some(
|
||||||
(notification) => notification.type === "emails"
|
(notification) => notification.type === "emails"
|
||||||
) ? (
|
) ? (
|
||||||
<Box mx={`calc(${theme.gap.ml} * 2)`}>
|
<Box mx={theme.spacing(16)}>
|
||||||
<Field
|
<Field
|
||||||
id="notify-email-list"
|
id="notify-email-list"
|
||||||
type="text"
|
type="text"
|
||||||
@@ -311,7 +321,7 @@ const CreateMonitor = () => {
|
|||||||
value=""
|
value=""
|
||||||
onChange={() => logger.warn("disabled")}
|
onChange={() => logger.warn("disabled")}
|
||||||
/>
|
/>
|
||||||
<Typography mt={theme.gap.small}>
|
<Typography mt={theme.spacing(4)}>
|
||||||
You can separate multiple emails with a comma
|
You can separate multiple emails with a comma
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -319,12 +329,12 @@ const CreateMonitor = () => {
|
|||||||
""
|
""
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
<Stack className="config-box">
|
<ConfigBox>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">Advanced settings</Typography>
|
<Typography component="h2">Advanced settings</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.gap.large}>
|
<Stack gap={theme.spacing(12)}>
|
||||||
<Select
|
<Select
|
||||||
id="monitor-interval"
|
id="monitor-interval"
|
||||||
label="Check frequency"
|
label="Check frequency"
|
||||||
@@ -332,73 +342,8 @@ const CreateMonitor = () => {
|
|||||||
onChange={(event) => handleChange(event, "interval")}
|
onChange={(event) => handleChange(event, "interval")}
|
||||||
items={frequencies}
|
items={frequencies}
|
||||||
/>
|
/>
|
||||||
{/* TODO */}
|
|
||||||
{/* <FlexibileTextField
|
|
||||||
id="monitor-settings-retries"
|
|
||||||
title="Maximum retries before the service is marked as down"
|
|
||||||
type="number"
|
|
||||||
value={advancedSettings.retries}
|
|
||||||
onChange={(event) =>
|
|
||||||
handleChange(event, "retries", setAdvancedSettings)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<FlexibileTextField
|
|
||||||
id="monitor-settings-codes"
|
|
||||||
title="Accepted status codes"
|
|
||||||
type="number"
|
|
||||||
value={advancedSettings.codes}
|
|
||||||
onChange={(event) =>
|
|
||||||
handleChange(event, "codes", setAdvancedSettings)
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
<FlexibileTextField
|
|
||||||
id="monitor-settings-redirects"
|
|
||||||
title="Maximum redirects"
|
|
||||||
type="number"
|
|
||||||
value={advancedSettings.redirects}
|
|
||||||
onChange={(event) =>
|
|
||||||
handleChange(event, "redirects", setAdvancedSettings)
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
{/* TODO */}
|
|
||||||
{/*
|
|
||||||
<ConfigBox
|
|
||||||
leftLayout={
|
|
||||||
<div className="config-box-desc">
|
|
||||||
<div className="config-box-desc-title">Proxy settings</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
rightLayout={
|
|
||||||
<div className="proxy-setting-config">
|
|
||||||
<CustomizableCheckBox
|
|
||||||
id="monitor-proxy-enable"
|
|
||||||
title="Enable proxy"
|
|
||||||
isChecked={proxy.enabled}
|
|
||||||
handleChange={() => handleCheck("enabled", setProxy)}
|
|
||||||
/>
|
|
||||||
<FlexibileTextField
|
|
||||||
id="monitor-proxy-protocol"
|
|
||||||
title="Proxy protocol"
|
|
||||||
value={proxy.protocol}
|
|
||||||
onChange={(event) => handleChange(event, "protocol", setProxy)}
|
|
||||||
/>
|
|
||||||
<FlexibileTextField
|
|
||||||
id="monitor-proxy-address"
|
|
||||||
title="Proxy address"
|
|
||||||
value={proxy.address}
|
|
||||||
onChange={(event) => handleChange(event, "address", setProxy)}
|
|
||||||
/>
|
|
||||||
<FlexibileTextField
|
|
||||||
id="monitor-proxy-port"
|
|
||||||
title="Proxy port"
|
|
||||||
value={proxy.proxy_port}
|
|
||||||
onChange={(event) => handleChange(event, "proxy_port", setProxy)}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
/> */}
|
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
<Stack direction="row" justifyContent="flex-end">
|
||||||
<Button
|
<Button
|
||||||
id="create-monitor-btn"
|
id="create-monitor-btn"
|
||||||
|
|||||||
@@ -1,25 +1,13 @@
|
|||||||
.monitor-details h1.MuiTypography-root {
|
.monitor-details h1.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large-plus);
|
font-size: var(--env-var-font-size-large-plus);
|
||||||
color: var(--primary-color);
|
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.monitor-details h2.MuiTypography-root {
|
.monitor-details h2.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large);
|
font-size: var(--env-var-font-size-large);
|
||||||
}
|
}
|
||||||
.monitor-details h2.MuiTypography-root{
|
.monitor-details h2.MuiTypography-root {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.monitor-details h2.MuiTypography-root,
|
|
||||||
.monitor-details h4.MuiTypography-root {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.monitor-details h6.MuiTypography-root {
|
|
||||||
color: var(--theme-main);
|
|
||||||
}
|
|
||||||
.monitor-details button.MuiButtonBase-root,
|
|
||||||
.monitor-details h4.MuiTypography-root {
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
|
||||||
}
|
|
||||||
.monitor-details button.MuiButtonBase-root {
|
.monitor-details button.MuiButtonBase-root {
|
||||||
height: var(--env-var-height-2);
|
height: var(--env-var-height-2);
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
@@ -28,28 +16,3 @@
|
|||||||
.monitor-details p.MuiTypography-root span.MuiTypography-root {
|
.monitor-details p.MuiTypography-root span.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-small-plus);
|
font-size: var(--env-var-font-size-small-plus);
|
||||||
}
|
}
|
||||||
.monitor-details p.MuiTypography-root {
|
|
||||||
color: var(--secondary-color-light);
|
|
||||||
}
|
|
||||||
|
|
||||||
.monitor-details .stat-box {
|
|
||||||
flex: 1 20%;
|
|
||||||
min-width: 100px;
|
|
||||||
border: solid 1px;
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
padding: var(--env-var-spacing-1) 16px;
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
}
|
|
||||||
.monitor-details h6.MuiTypography-root {
|
|
||||||
font-size: var(--env-var-font-size-medium-plus);
|
|
||||||
}
|
|
||||||
.monitor-details h6.MuiTypography-root span.MuiTypography-root {
|
|
||||||
font-style: italic;
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
|
||||||
color: var(--secondary-color);
|
|
||||||
opacity: 0.7;
|
|
||||||
}
|
|
||||||
.monitor-details button.MuiButtonBase-root,
|
|
||||||
.monitor-details .stat-box {
|
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useEffect, useState, useCallback } from "react";
|
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
import { useEffect, useState, useCallback } from "react";
|
||||||
import { Box, Skeleton, Stack, Typography, useTheme } from "@mui/material";
|
import { Box, Skeleton, Stack, Typography, useTheme } from "@mui/material";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { useNavigate, useParams } from "react-router-dom";
|
import { useNavigate, useParams } from "react-router-dom";
|
||||||
@@ -19,12 +19,41 @@ import PulseDot from "../../../Components/Animated/PulseDot";
|
|||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
const StatBox = ({ title, value }) => {
|
const StatBox = ({ title, value }) => {
|
||||||
|
const theme = useTheme();
|
||||||
return (
|
return (
|
||||||
<Box className="stat-box">
|
<Box
|
||||||
<Typography variant="h6" mb={1} fontWeight={500}>
|
className="stat-box"
|
||||||
|
flex="20%"
|
||||||
|
minWidth="100px"
|
||||||
|
px={theme.spacing(8)}
|
||||||
|
py={theme.spacing(4)}
|
||||||
|
border={1}
|
||||||
|
borderColor={theme.palette.border.light}
|
||||||
|
borderRadius={theme.shape.borderRadius}
|
||||||
|
backgroundColor={theme.palette.background.main}
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
variant="h6"
|
||||||
|
mb={theme.spacing(2)}
|
||||||
|
fontSize={14}
|
||||||
|
fontWeight={500}
|
||||||
|
color={theme.palette.common.main}
|
||||||
|
sx={{
|
||||||
|
"& span": {
|
||||||
|
color: theme.palette.text.accent,
|
||||||
|
fontSize: 13,
|
||||||
|
fontStyle: "italic",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
{title}
|
{title}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="h4" fontWeight={500}>
|
<Typography
|
||||||
|
variant="h4"
|
||||||
|
fontWeight={500}
|
||||||
|
fontSize={13}
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
{value}
|
{value}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -47,8 +76,8 @@ const SkeletonLayout = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Skeleton variant="rounded" width="20%" height={34} />
|
<Skeleton variant="rounded" width="20%" height={34} />
|
||||||
<Stack gap={theme.gap.xl} mt={theme.gap.medium}>
|
<Stack gap={theme.spacing(20)} mt={theme.spacing(6)}>
|
||||||
<Stack direction="row" gap={theme.gap.small} mt={theme.gap.small}>
|
<Stack direction="row" gap={theme.spacing(4)} mt={theme.spacing(4)}>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
variant="circular"
|
variant="circular"
|
||||||
style={{ minWidth: 24, minHeight: 24 }}
|
style={{ minWidth: 24, minHeight: 24 }}
|
||||||
@@ -59,7 +88,7 @@ const SkeletonLayout = () => {
|
|||||||
variant="rounded"
|
variant="rounded"
|
||||||
width="50%"
|
width="50%"
|
||||||
height={18}
|
height={18}
|
||||||
sx={{ mt: theme.gap.small }}
|
sx={{ mt: theme.spacing(4) }}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
@@ -72,7 +101,7 @@ const SkeletonLayout = () => {
|
|||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
>
|
>
|
||||||
<Skeleton variant="rounded" width="100%" height={80} />
|
<Skeleton variant="rounded" width="100%" height={80} />
|
||||||
<Skeleton variant="rounded" width="100%" height={80} />
|
<Skeleton variant="rounded" width="100%" height={80} />
|
||||||
@@ -82,7 +111,7 @@ const SkeletonLayout = () => {
|
|||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
mb={theme.gap.ml}
|
mb={theme.spacing(8)}
|
||||||
>
|
>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
variant="rounded"
|
variant="rounded"
|
||||||
@@ -96,7 +125,7 @@ const SkeletonLayout = () => {
|
|||||||
<Skeleton variant="rounded" width="100%" height="100%" />
|
<Skeleton variant="rounded" width="100%" height="100%" />
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.gap.ml}>
|
<Stack gap={theme.spacing(8)}>
|
||||||
<Skeleton variant="rounded" width="20%" height={24} />
|
<Skeleton variant="rounded" width="20%" height={24} />
|
||||||
<Skeleton variant="rounded" width="100%" height={200} />
|
<Skeleton variant="rounded" width="100%" height={200} />
|
||||||
<Skeleton variant="rounded" width="100%" height={50} />
|
<Skeleton variant="rounded" width="100%" height={50} />
|
||||||
@@ -169,26 +198,33 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
{ name: "details", path: `/monitors/${monitorId}` },
|
{ name: "details", path: `/monitors/${monitorId}` },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Stack gap={theme.gap.large} mt={theme.gap.large}>
|
<Stack gap={theme.spacing(12)} mt={theme.spacing(12)}>
|
||||||
<Stack direction="row" gap={theme.gap.xs}>
|
<Stack direction="row" gap={theme.spacing(2)}>
|
||||||
<PulseDot
|
<PulseDot
|
||||||
color={
|
color={
|
||||||
monitor?.status
|
monitor?.status
|
||||||
? theme.label.up.dotColor
|
? theme.palette.success.main
|
||||||
: theme.label.down.dotColor
|
: theme.palette.error.main
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h1" sx={{ lineHeight: 1 }}>
|
<Typography
|
||||||
|
component="h1"
|
||||||
|
color={theme.palette.text.primary}
|
||||||
|
lineHeight={1}
|
||||||
|
>
|
||||||
{monitor.url?.replace(/^https?:\/\//, "") || "..."}
|
{monitor.url?.replace(/^https?:\/\//, "") || "..."}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography mt={theme.gap.small}>
|
<Typography
|
||||||
|
mt={theme.spacing(4)}
|
||||||
|
color={theme.palette.text.tertiary}
|
||||||
|
>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
sx={{
|
sx={{
|
||||||
color: monitor?.status
|
color: monitor?.status
|
||||||
? "var(--env-var-color-17)"
|
? theme.palette.success.main
|
||||||
: "var(--env-var-color-24)",
|
: theme.palette.success.text,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Your site is {monitor?.status ? "up" : "down"}.
|
Your site is {monitor?.status ? "up" : "down"}.
|
||||||
@@ -204,8 +240,8 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
img={
|
img={
|
||||||
<SettingsIcon
|
<SettingsIcon
|
||||||
style={{
|
style={{
|
||||||
minWidth: theme.gap.mlplus,
|
minWidth: theme.spacing(10),
|
||||||
minHeight: theme.gap.mlplus,
|
minHeight: theme.spacing(10),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@@ -213,10 +249,10 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
sx={{
|
sx={{
|
||||||
ml: "auto",
|
ml: "auto",
|
||||||
alignSelf: "flex-end",
|
alignSelf: "flex-end",
|
||||||
backgroundColor: "#f4f4f4",
|
backgroundColor: theme.palette.background.fill,
|
||||||
px: theme.gap.medium,
|
px: theme.spacing(6),
|
||||||
"& svg": {
|
"& svg": {
|
||||||
mr: "6px",
|
mr: theme.spacing(3),
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -225,7 +261,7 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
flexWrap="wrap"
|
flexWrap="wrap"
|
||||||
>
|
>
|
||||||
<StatBox
|
<StatBox
|
||||||
@@ -278,20 +314,29 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
mb={theme.gap.ml}
|
mb={theme.spacing(8)}
|
||||||
>
|
>
|
||||||
<Typography component="h2" alignSelf="flex-end">
|
<Typography
|
||||||
|
component="h2"
|
||||||
|
alignSelf="flex-end"
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
Response Times
|
Response Times
|
||||||
</Typography>
|
</Typography>
|
||||||
<ButtonGroup>
|
<ButtonGroup
|
||||||
|
sx={{
|
||||||
|
"& .MuiButtonBase-root": {
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
level="secondary"
|
||||||
label="Day"
|
label="Day"
|
||||||
onClick={() => setDateRange("day")}
|
onClick={() => setDateRange("day")}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
dateRange === "day" &&
|
dateRange === "day" && theme.palette.background.fill,
|
||||||
theme.palette.otherColors.fillGray,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
@@ -300,8 +345,7 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
onClick={() => setDateRange("week")}
|
onClick={() => setDateRange("week")}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
dateRange === "week" &&
|
dateRange === "week" && theme.palette.background.fill,
|
||||||
theme.palette.otherColors.fillGray,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
@@ -310,19 +354,18 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
onClick={() => setDateRange("month")}
|
onClick={() => setDateRange("month")}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
dateRange === "month" &&
|
dateRange === "month" && theme.palette.background.fill,
|
||||||
theme.palette.otherColors.fillGray,
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Box
|
<Box
|
||||||
p={theme.gap.mlplus}
|
p={theme.spacing(10)}
|
||||||
pb={theme.gap.xs}
|
pb={theme.spacing(2)}
|
||||||
backgroundColor={theme.palette.otherColors.white}
|
backgroundColor={theme.palette.background.main}
|
||||||
border={1}
|
border={1}
|
||||||
borderColor={theme.palette.otherColors.graishWhite}
|
borderColor={theme.palette.border.light}
|
||||||
borderRadius={`${theme.shape.borderRadius}px`}
|
borderRadius={theme.shape.borderRadius}
|
||||||
sx={{ height: "250px" }}
|
sx={{ height: "250px" }}
|
||||||
>
|
>
|
||||||
<MonitorDetailsAreaChart
|
<MonitorDetailsAreaChart
|
||||||
@@ -330,8 +373,10 @@ const DetailsPage = ({ isAdmin }) => {
|
|||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack gap={theme.gap.ml}>
|
<Stack gap={theme.spacing(8)}>
|
||||||
<Typography component="h2">History</Typography>
|
<Typography component="h2" color={theme.palette.text.secondary}>
|
||||||
|
History
|
||||||
|
</Typography>
|
||||||
<PaginationTable monitorId={monitorId} dateRange={dateRange} />
|
<PaginationTable monitorId={monitorId} dateRange={dateRange} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -13,21 +13,21 @@ const StatusBox = ({ title, value }) => {
|
|||||||
let color;
|
let color;
|
||||||
let icon;
|
let icon;
|
||||||
if (title === "up") {
|
if (title === "up") {
|
||||||
color = theme.pie.green.stroke;
|
color = theme.palette.success.main;
|
||||||
icon = (
|
icon = (
|
||||||
<Box sx={{ ...sharedStyles, top: 8 }}>
|
<Box sx={{ ...sharedStyles, top: 8 }}>
|
||||||
<Arrow />
|
<Arrow />
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
} else if (title === "down") {
|
} else if (title === "down") {
|
||||||
color = theme.pie.red.stroke;
|
color = theme.palette.error.text;
|
||||||
icon = (
|
icon = (
|
||||||
<Box sx={{ ...sharedStyles, transform: "rotate(180deg)", top: 5 }}>
|
<Box sx={{ ...sharedStyles, transform: "rotate(180deg)", top: 5 }}>
|
||||||
<Arrow />
|
<Arrow />
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
} else if (title === "paused") {
|
} else if (title === "paused") {
|
||||||
color = theme.pie.yellow.stroke;
|
color = theme.palette.warning.main;
|
||||||
icon = (
|
icon = (
|
||||||
<Box sx={{ ...sharedStyles, top: 12, right: 12 }}>
|
<Box sx={{ ...sharedStyles, top: 12, right: 12 }}>
|
||||||
<ClockSnooze />
|
<ClockSnooze />
|
||||||
@@ -40,11 +40,11 @@ const StatusBox = ({ title, value }) => {
|
|||||||
position="relative"
|
position="relative"
|
||||||
flex={1}
|
flex={1}
|
||||||
border={1}
|
border={1}
|
||||||
borderColor={theme.palette.otherColors.graishWhite}
|
borderColor={theme.palette.border.light}
|
||||||
borderRadius={`${theme.shape.borderRadius}px`}
|
borderRadius={theme.shape.borderRadius}
|
||||||
backgroundColor={theme.palette.otherColors.white}
|
backgroundColor={theme.palette.background.main}
|
||||||
px={theme.gap.large}
|
px={theme.spacing(12)}
|
||||||
py={theme.gap.ml}
|
py={theme.spacing(8)}
|
||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
sx={{
|
sx={{
|
||||||
"&:hover": {
|
"&:hover": {
|
||||||
@@ -67,8 +67,8 @@ const StatusBox = ({ title, value }) => {
|
|||||||
textTransform="uppercase"
|
textTransform="uppercase"
|
||||||
fontSize={15}
|
fontSize={15}
|
||||||
letterSpacing={0.5}
|
letterSpacing={0.5}
|
||||||
color={theme.palette.otherColors.bluishGray}
|
color={theme.palette.text.secondary}
|
||||||
mb={theme.gap.ml}
|
mb={theme.spacing(8)}
|
||||||
sx={{ opacity: 0.6 }}
|
sx={{ opacity: 0.6 }}
|
||||||
>
|
>
|
||||||
{title}
|
{title}
|
||||||
@@ -87,7 +87,7 @@ const StatusBox = ({ title, value }) => {
|
|||||||
component="span"
|
component="span"
|
||||||
fontSize={20}
|
fontSize={20}
|
||||||
fontWeight={300}
|
fontWeight={300}
|
||||||
color={theme.palette.otherColors.bluishGray}
|
color={theme.palette.text.secondary}
|
||||||
sx={{ opacity: 0.3 }}
|
sx={{ opacity: 0.3 }}
|
||||||
>
|
>
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useSelector, useDispatch } from "react-redux";
|
import { useSelector, useDispatch } from "react-redux";
|
||||||
|
import { useTheme } from "@emotion/react";
|
||||||
|
import { useNavigate } from "react-router-dom";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
import {
|
import {
|
||||||
IconButton,
|
IconButton,
|
||||||
@@ -14,10 +16,8 @@ import {
|
|||||||
getUptimeMonitorsByTeamId,
|
getUptimeMonitorsByTeamId,
|
||||||
} from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
} from "../../../Features/UptimeMonitors/uptimeMonitorsSlice";
|
||||||
import Settings from "../../../assets/icons/settings-bold.svg?react";
|
import Settings from "../../../assets/icons/settings-bold.svg?react";
|
||||||
import { useTheme } from "@emotion/react";
|
|
||||||
import Button from "../../../Components/Button";
|
import Button from "../../../Components/Button";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { useNavigate } from "react-router-dom";
|
|
||||||
|
|
||||||
const ActionsMenu = ({ monitor, isAdmin }) => {
|
const ActionsMenu = ({ monitor, isAdmin }) => {
|
||||||
const [anchorEl, setAnchorEl] = useState(null);
|
const [anchorEl, setAnchorEl] = useState(null);
|
||||||
@@ -87,6 +87,30 @@ const ActionsMenu = ({ monitor, isAdmin }) => {
|
|||||||
anchorEl={anchorEl}
|
anchorEl={anchorEl}
|
||||||
open={Boolean(anchorEl)}
|
open={Boolean(anchorEl)}
|
||||||
onClose={(e) => closeMenu(e)}
|
onClose={(e) => closeMenu(e)}
|
||||||
|
slotProps={{
|
||||||
|
paper: {
|
||||||
|
sx: {
|
||||||
|
border: 1,
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
|
boxShadow: theme.shape.boxShadow,
|
||||||
|
"& ul": {
|
||||||
|
p: theme.spacing(2.5),
|
||||||
|
minWidth: "100px",
|
||||||
|
},
|
||||||
|
"& li": {
|
||||||
|
color: theme.palette.text.secondary,
|
||||||
|
fontSize: 13,
|
||||||
|
px: theme.spacing(4),
|
||||||
|
py: theme.spacing(2.5),
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
|
},
|
||||||
|
"& li:last-of-type": {
|
||||||
|
color: theme.palette.error.text,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
{actions.url !== null ? (
|
{actions.url !== null ? (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
@@ -137,31 +161,35 @@ const ActionsMenu = ({ monitor, isAdmin }) => {
|
|||||||
aria-labelledby="modal-delete-monitor"
|
aria-labelledby="modal-delete-monitor"
|
||||||
aria-describedby="delete-monitor-confirmation"
|
aria-describedby="delete-monitor-confirmation"
|
||||||
open={isOpen}
|
open={isOpen}
|
||||||
onClose={() => setIsOpen(false)}
|
onClose={(e) => {
|
||||||
disablePortal
|
e.stopPropagation();
|
||||||
|
setIsOpen(false);
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
gap={theme.gap.xs}
|
gap={theme.spacing(2)}
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
sx={{
|
sx={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
top: "50%",
|
top: "50%",
|
||||||
left: "50%",
|
left: "50%",
|
||||||
transform: "translate(-50%, -50%)",
|
transform: "translate(-50%, -50%)",
|
||||||
width: 400,
|
width: 400,
|
||||||
bgcolor: "white",
|
bgcolor: theme.palette.background.main,
|
||||||
border: "solid 1px #f2f2f2",
|
border: 1,
|
||||||
borderRadius: `${theme.shape.borderRadius}px`,
|
borderColor: theme.palette.border.light,
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
boxShadow: 24,
|
boxShadow: 24,
|
||||||
p: "30px",
|
p: theme.spacing(15),
|
||||||
"&:focus": {
|
"&:focus": {
|
||||||
outline: "none",
|
outline: "none",
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography id="modal-delete-monitor" component="h2">
|
<Typography id="modal-delete-monitor" component="h2" fontWeight={600}>
|
||||||
Do you really want to delete this monitor?
|
Do you really want to delete this monitor?
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography id="delete-monitor-confirmation">
|
<Typography id="delete-monitor-confirmation" fontSize={13}>
|
||||||
Once deleted, this monitor cannot be retrieved.
|
Once deleted, this monitor cannot be retrieved.
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stack
|
<Stack
|
||||||
@@ -173,12 +201,18 @@ const ActionsMenu = ({ monitor, isAdmin }) => {
|
|||||||
<Button
|
<Button
|
||||||
level="tertiary"
|
level="tertiary"
|
||||||
label="Cancel"
|
label="Cancel"
|
||||||
onClick={() => setIsOpen(false)}
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
setIsOpen(false);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
level="error"
|
level="error"
|
||||||
label="Delete"
|
label="Delete"
|
||||||
onClick={(e) => handleRemove(e)}
|
onClick={(e) => {
|
||||||
|
e.stopPropagation(e);
|
||||||
|
handleRemove(e);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -11,12 +11,13 @@ const Fallback = ({ isAdmin }) => {
|
|||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
backgroundColor={theme.palette.otherColors.white}
|
backgroundColor={theme.palette.background.main}
|
||||||
p={theme.gap.xxl}
|
p={theme.spacing(30)}
|
||||||
gap={theme.gap.xs}
|
gap={theme.spacing(2)}
|
||||||
border={1}
|
border={1}
|
||||||
borderRadius={`${theme.shape.borderRadius}px`}
|
borderRadius={theme.shape.borderRadius}
|
||||||
borderColor={theme.palette.otherColors.graishWhite}
|
borderColor={theme.palette.border.light}
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
>
|
>
|
||||||
<Typography component="h2">No monitors found</Typography>
|
<Typography component="h2">No monitors found</Typography>
|
||||||
<Typography>
|
<Typography>
|
||||||
@@ -29,7 +30,7 @@ const Fallback = ({ isAdmin }) => {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate("/monitors/create");
|
navigate("/monitors/create");
|
||||||
}}
|
}}
|
||||||
sx={{ mt: theme.gap.large }}
|
sx={{ mt: theme.spacing(12) }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Typography } from "@mui/material";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
/**
|
/**
|
||||||
* Host component.
|
* Host component.
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
.monitors h1.MuiTypography-root {
|
.monitors h1.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large-plus);
|
font-size: var(--env-var-font-size-large-plus);
|
||||||
color: var(--primary-color);
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
.monitors h2.MuiTypography-root {
|
.monitors h2.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large);
|
font-size: var(--env-var-font-size-large);
|
||||||
color: var(--secondary-color);
|
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
.monitors p.MuiTypography-root {
|
.monitors p.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-medium);
|
font-size: var(--env-var-font-size-medium);
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
}
|
||||||
.monitors h1.MuiTypography-root + p.MuiTypography-root {
|
.monitors h1.MuiTypography-root + p.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-medium-plus);
|
font-size: var(--env-var-font-size-medium-plus);
|
||||||
@@ -28,36 +25,9 @@
|
|||||||
padding: 5px;
|
padding: 5px;
|
||||||
min-width: 25px;
|
min-width: 25px;
|
||||||
min-height: 25px;
|
min-height: 25px;
|
||||||
background-color: var(--unresolved-bg);
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
font-size: var(--env-var-font-size-medium);
|
font-size: var(--env-var-font-size-medium);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: var(--primary-color);
|
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
line-height: 0.8;
|
line-height: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
body:has(.monitors) .actions-menu .MuiPaper-root {
|
|
||||||
box-shadow: var(--env-var-shadow-1);
|
|
||||||
border: solid 1px var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
gap: 1px;
|
|
||||||
}
|
|
||||||
body:has(.monitors) .actions-menu .MuiList-root {
|
|
||||||
padding: 6px 8px;
|
|
||||||
min-width: 100px;
|
|
||||||
}
|
|
||||||
body:has(.monitors) .actions-menu li.MuiButtonBase-root {
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
|
||||||
color: var(--secondary-color);
|
|
||||||
padding: 5px 8px;
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
}
|
|
||||||
body:has(.monitors) .actions-menu li.MuiButtonBase-root:last-of-type {
|
|
||||||
color: var(--error-color);
|
|
||||||
}
|
|
||||||
body:has(.monitors) .actions-menu .MuiModal-root p.MuiTypography-root {
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
|
||||||
color: var(--secondary-color-light);
|
|
||||||
}
|
|
||||||
@@ -51,7 +51,7 @@ const Monitors = ({ isAdmin }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="monitors" gap={theme.gap.large}>
|
<Stack className="monitors" gap={theme.spacing(12)}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<SkeletonLayout />
|
<SkeletonLayout />
|
||||||
) : (
|
) : (
|
||||||
@@ -65,11 +65,15 @@ const Monitors = ({ isAdmin }) => {
|
|||||||
mt={theme.spacing(5)}
|
mt={theme.spacing(5)}
|
||||||
>
|
>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h1" lineHeight={1}>
|
<Typography
|
||||||
|
component="h1"
|
||||||
|
lineHeight={1}
|
||||||
|
color={theme.palette.text.primary}
|
||||||
|
>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
fontSize="inherit"
|
fontSize="inherit"
|
||||||
color={theme.palette.otherColors.bluishGray}
|
color={theme.palette.text.secondary}
|
||||||
>
|
>
|
||||||
Good {greeting},{" "}
|
Good {greeting},{" "}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -85,6 +89,7 @@ const Monitors = ({ isAdmin }) => {
|
|||||||
sx={{ opacity: 0.8 }}
|
sx={{ opacity: 0.8 }}
|
||||||
lineHeight={1}
|
lineHeight={1}
|
||||||
fontWeight={300}
|
fontWeight={300}
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
>
|
>
|
||||||
Here’s an overview of your uptime monitors.
|
Here’s an overview of your uptime monitors.
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -108,7 +113,7 @@ const Monitors = ({ isAdmin }) => {
|
|||||||
{monitorState.monitors?.length !== 0 && (
|
{monitorState.monitors?.length !== 0 && (
|
||||||
<>
|
<>
|
||||||
<Stack
|
<Stack
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
>
|
>
|
||||||
@@ -118,17 +123,30 @@ const Monitors = ({ isAdmin }) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
<Box
|
<Box
|
||||||
flex={1}
|
flex={1}
|
||||||
p={theme.gap.lgplus}
|
p={theme.spacing(16)}
|
||||||
border={1}
|
border={1}
|
||||||
borderColor={theme.palette.otherColors.graishWhite}
|
borderColor={theme.palette.border.light}
|
||||||
backgroundColor={theme.palette.otherColors.white}
|
borderRadius={theme.shape.borderRadius}
|
||||||
sx={{
|
backgroundColor={theme.palette.background.main}
|
||||||
borderRadius: `${theme.shape.borderRadius}px`,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Stack direction="row" alignItems="center" mb={theme.gap.large}>
|
<Stack
|
||||||
<Typography component="h2">Current monitors</Typography>
|
direction="row"
|
||||||
<Box className="current-monitors-counter">
|
alignItems="center"
|
||||||
|
mb={theme.spacing(12)}
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
component="h2"
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
|
Current monitors
|
||||||
|
</Typography>
|
||||||
|
<Box
|
||||||
|
className="current-monitors-counter"
|
||||||
|
color={theme.palette.text.primary}
|
||||||
|
border={1}
|
||||||
|
borderColor={theme.palette.border.light}
|
||||||
|
backgroundColor={theme.palette.unresolved.bg}
|
||||||
|
>
|
||||||
{monitorState.monitors.length}
|
{monitorState.monitors.length}
|
||||||
</Box>
|
</Box>
|
||||||
{/* TODO - add search bar */}
|
{/* TODO - add search bar */}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ const SkeletonLayout = () => {
|
|||||||
<Skeleton variant="rounded" width="15%" height={36} />
|
<Skeleton variant="rounded" width="15%" height={36} />
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack
|
<Stack
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
>
|
>
|
||||||
@@ -24,7 +24,11 @@ const SkeletonLayout = () => {
|
|||||||
<Skeleton variant="rounded" width="100%" height={100} />
|
<Skeleton variant="rounded" width="100%" height={100} />
|
||||||
<Skeleton variant="rounded" width="100%" height={100} />
|
<Skeleton variant="rounded" width="100%" height={100} />
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack gap={theme.gap.large} p={theme.gap.xl} backgroundColor="#f9fafb">
|
<Stack
|
||||||
|
gap={theme.spacing(12)}
|
||||||
|
p={theme.spacing(20)}
|
||||||
|
backgroundColor="#f9fafb"
|
||||||
|
>
|
||||||
<Skeleton variant="rounded" width="50%" height={25} />
|
<Skeleton variant="rounded" width="50%" height={25} />
|
||||||
<Skeleton variant="rounded" width="100%" height={300} />
|
<Skeleton variant="rounded" width="100%" height={300} />
|
||||||
<Skeleton variant="rounded" width="100%" height={100} />
|
<Skeleton variant="rounded" width="100%" height={100} />
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import { Stack, styled } from "@mui/material";
|
||||||
|
|
||||||
|
export const ConfigBox = styled(Stack)(({ theme }) => ({
|
||||||
|
flexDirection: "row",
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
borderRadius: theme.spacing(2),
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
|
"& > *": {
|
||||||
|
paddingTop: theme.spacing(12),
|
||||||
|
paddingBottom: theme.spacing(18),
|
||||||
|
},
|
||||||
|
"& > div:first-of-type": {
|
||||||
|
flex: 0.7,
|
||||||
|
borderRight: 1,
|
||||||
|
borderRightStyle: "solid",
|
||||||
|
borderRightColor: theme.palette.border.light,
|
||||||
|
paddingRight: theme.spacing(15),
|
||||||
|
paddingLeft: theme.spacing(15),
|
||||||
|
},
|
||||||
|
"& > div:last-of-type": {
|
||||||
|
flex: 1,
|
||||||
|
paddingRight: theme.spacing(20),
|
||||||
|
paddingLeft: theme.spacing(18),
|
||||||
|
},
|
||||||
|
"& h2": {
|
||||||
|
color: theme.palette.text.secondary,
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: 600,
|
||||||
|
},
|
||||||
|
"& h3, & p": {
|
||||||
|
color: theme.palette.text.tertiary,
|
||||||
|
},
|
||||||
|
}));
|
||||||
@@ -1,23 +1,9 @@
|
|||||||
.configure-pagespeed form > .MuiStack-root:nth-child(2) {
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
border: solid 1px var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
padding: var(--env-var-font-size-large-plus) var(--env-var-font-size-xlarge);
|
|
||||||
}
|
|
||||||
.configure-pagespeed h1.MuiTypography-root {
|
.configure-pagespeed h1.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large-plus);
|
font-size: var(--env-var-font-size-large-plus);
|
||||||
}
|
}
|
||||||
.configure-pagespeed h1.MuiTypography-root,
|
|
||||||
.configure-pagespeed h2.MuiTypography-root {
|
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
|
||||||
.configure-pagespeed span.MuiTypography-root {
|
.configure-pagespeed span.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-small-plus);
|
font-size: var(--env-var-font-size-small-plus);
|
||||||
}
|
}
|
||||||
.configure-pagespeed p.MuiTypography-root,
|
|
||||||
.configure-pagespeed h3.MuiTypography-root {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.configure-pagespeed h1.MuiTypography-root,
|
.configure-pagespeed h1.MuiTypography-root,
|
||||||
.configure-pagespeed h3.MuiTypography-root,
|
.configure-pagespeed h3.MuiTypography-root,
|
||||||
.configure-pagespeed h2.MuiTypography-root {
|
.configure-pagespeed h2.MuiTypography-root {
|
||||||
@@ -38,13 +24,10 @@
|
|||||||
.configure-pagespeed .checkbox-wrapper {
|
.configure-pagespeed .checkbox-wrapper {
|
||||||
margin-bottom: 1px;
|
margin-bottom: 1px;
|
||||||
}
|
}
|
||||||
.configure-pagespeed .MuiInputBase-root:has(> .Mui-disabled) {
|
|
||||||
background-color: var(--primary-bg-accent);
|
|
||||||
}
|
|
||||||
/* to be removed */
|
/* to be removed */
|
||||||
.configure-pagespeed .section-disabled {
|
.configure-pagespeed .section-disabled {
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
background-color: #f1f1f2;
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
@@ -55,11 +38,6 @@
|
|||||||
height: var(--env-var-height-2);
|
height: var(--env-var-height-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
body:has(.configure-pagespeed) .select-dropdown .MuiMenuItem-root,
|
|
||||||
.configure-pagespeed .select-wrapper .select-component > .MuiSelect-select {
|
|
||||||
text-transform: lowercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.configure-pagespeed h3.MuiTypography-root {
|
.configure-pagespeed h3.MuiTypography-root {
|
||||||
flex: 0.7;
|
flex: 0.7;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ const SkeletonLayout = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Skeleton variant="rounded" width="15%" height={34} />
|
<Skeleton variant="rounded" width="15%" height={34} />
|
||||||
<Stack gap={theme.gap.xl} mt={theme.gap.medium} maxWidth="1000px">
|
<Stack gap={theme.spacing(20)} mt={theme.spacing(6)} maxWidth="1000px">
|
||||||
<Stack direction="row" gap={theme.gap.small} mt={theme.gap.small}>
|
<Stack direction="row" gap={theme.spacing(4)} mt={theme.spacing(4)}>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
variant="circular"
|
variant="circular"
|
||||||
style={{ minWidth: 24, minHeight: 24 }}
|
style={{ minWidth: 24, minHeight: 24 }}
|
||||||
@@ -43,13 +43,13 @@ const SkeletonLayout = () => {
|
|||||||
variant="rounded"
|
variant="rounded"
|
||||||
width="50%"
|
width="50%"
|
||||||
height={24}
|
height={24}
|
||||||
sx={{ mb: theme.gap.small }}
|
sx={{ mb: theme.spacing(4) }}
|
||||||
/>
|
/>
|
||||||
<Skeleton variant="rounded" width="50%" height={18} />
|
<Skeleton variant="rounded" width="50%" height={18} />
|
||||||
</Box>
|
</Box>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.gap.medium}
|
gap={theme.spacing(6)}
|
||||||
sx={{
|
sx={{
|
||||||
ml: "auto",
|
ml: "auto",
|
||||||
alignSelf: "flex-end",
|
alignSelf: "flex-end",
|
||||||
@@ -147,7 +147,7 @@ const PageSpeedConfigure = () => {
|
|||||||
let loading = Object.keys(monitor).length === 0;
|
let loading = Object.keys(monitor).length === 0;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="configure-pagespeed" gap={theme.gap.large}>
|
<Stack className="configure-pagespeed" gap={theme.spacing(12)}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<SkeletonLayout />
|
<SkeletonLayout />
|
||||||
) : (
|
) : (
|
||||||
@@ -165,21 +165,22 @@ const PageSpeedConfigure = () => {
|
|||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
onSubmit={handleSave}
|
onSubmit={handleSave}
|
||||||
flex={1}
|
flex={1}
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
>
|
>
|
||||||
<Stack direction="row" gap={theme.gap.xs}>
|
<Stack direction="row" gap={theme.spacing(2)}>
|
||||||
<PulseDot
|
<PulseDot
|
||||||
color={
|
color={
|
||||||
monitor?.status
|
monitor?.status
|
||||||
? theme.label.up.dotColor
|
? theme.palette.success.main
|
||||||
: theme.label.down.dotColor
|
: theme.palette.error.main
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography
|
<Typography
|
||||||
component="h1"
|
component="h1"
|
||||||
mb={theme.gap.xs}
|
mb={theme.spacing(2)}
|
||||||
sx={{ lineHeight: 1 }}
|
sx={{ lineHeight: 1 }}
|
||||||
|
color={theme.palette.text.primary}
|
||||||
>
|
>
|
||||||
{monitor?.url}
|
{monitor?.url}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -187,8 +188,8 @@ const PageSpeedConfigure = () => {
|
|||||||
component="span"
|
component="span"
|
||||||
sx={{
|
sx={{
|
||||||
color: monitor?.status
|
color: monitor?.status
|
||||||
? "var(--success-color)"
|
? theme.palette.success.main
|
||||||
: "var(--error-color)",
|
: theme.palette.error.text,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Your pagespeed monitor is {monitor?.status ? "live" : "down"}.
|
Your pagespeed monitor is {monitor?.status ? "live" : "down"}.
|
||||||
@@ -201,11 +202,11 @@ const PageSpeedConfigure = () => {
|
|||||||
animate="rotate180"
|
animate="rotate180"
|
||||||
img={<PauseCircleOutlineIcon />}
|
img={<PauseCircleOutlineIcon />}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor: theme.palette.otherColors.fillGray,
|
backgroundColor: theme.palette.background.fill,
|
||||||
pl: theme.gap.small,
|
pl: theme.spacing(4),
|
||||||
pr: theme.gap.medium,
|
pr: theme.spacing(6),
|
||||||
"& svg": {
|
"& svg": {
|
||||||
mr: theme.gap.xs,
|
mr: theme.spacing(2),
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@@ -214,14 +215,27 @@ const PageSpeedConfigure = () => {
|
|||||||
label="Remove"
|
label="Remove"
|
||||||
sx={{
|
sx={{
|
||||||
boxShadow: "none",
|
boxShadow: "none",
|
||||||
px: theme.gap.ml,
|
px: theme.spacing(8),
|
||||||
ml: theme.gap.medium,
|
ml: theme.spacing(6),
|
||||||
}}
|
}}
|
||||||
onClick={() => setIsOpen(true)}
|
onClick={() => setIsOpen(true)}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack gap={theme.gap.xl}>
|
<Stack
|
||||||
|
border={1}
|
||||||
|
borderColor={theme.palette.border.light}
|
||||||
|
borderRadius={theme.shape.borderRadius}
|
||||||
|
backgroundColor={theme.palette.background.main}
|
||||||
|
p={theme.spacing(20)}
|
||||||
|
pl={theme.spacing(15)}
|
||||||
|
gap={theme.spacing(20)}
|
||||||
|
sx={{
|
||||||
|
"& h3, & p": {
|
||||||
|
color: theme.palette.text.secondary,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack direction="row">
|
<Stack direction="row">
|
||||||
<Typography component="h3">Monitor display name</Typography>
|
<Typography component="h3">Monitor display name</Typography>
|
||||||
<Field
|
<Field
|
||||||
@@ -233,7 +247,14 @@ const PageSpeedConfigure = () => {
|
|||||||
error={errors.name}
|
error={errors.name}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="row">
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
sx={{
|
||||||
|
".MuiInputBase-root:has(> .Mui-disabled)": {
|
||||||
|
backgroundColor: theme.palette.background.accent,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Typography component="h3">URL</Typography>
|
<Typography component="h3">URL</Typography>
|
||||||
<Field
|
<Field
|
||||||
type="url"
|
type="url"
|
||||||
@@ -259,8 +280,11 @@ const PageSpeedConfigure = () => {
|
|||||||
Incidents notifications{" "}
|
Incidents notifications{" "}
|
||||||
<Typography component="span">(coming soon)</Typography>
|
<Typography component="span">(coming soon)</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stack className="section-disabled">
|
<Stack
|
||||||
<Typography mb={theme.gap.small}>
|
className="section-disabled"
|
||||||
|
backgroundColor={theme.palette.background.fill}
|
||||||
|
>
|
||||||
|
<Typography mb={theme.spacing(4)}>
|
||||||
When there is a new incident,
|
When there is a new incident,
|
||||||
</Typography>
|
</Typography>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -279,7 +303,7 @@ const PageSpeedConfigure = () => {
|
|||||||
label="Notify via email to following emails"
|
label="Notify via email to following emails"
|
||||||
isChecked={false}
|
isChecked={false}
|
||||||
/>
|
/>
|
||||||
<Box mx={`calc(${theme.gap.ml} * 2)`}>
|
<Box mx={theme.spacing(16)}>
|
||||||
<Field
|
<Field
|
||||||
id="notify-emails-list"
|
id="notify-emails-list"
|
||||||
placeholder="notifications@gmail.com"
|
placeholder="notifications@gmail.com"
|
||||||
@@ -287,7 +311,7 @@ const PageSpeedConfigure = () => {
|
|||||||
onChange={() => logger.warn("disabled")}
|
onChange={() => logger.warn("disabled")}
|
||||||
error=""
|
error=""
|
||||||
/>
|
/>
|
||||||
<Typography mt={theme.gap.small}>
|
<Typography mt={theme.spacing(4)}>
|
||||||
You can separate multiple emails with a comma
|
You can separate multiple emails with a comma
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -300,7 +324,7 @@ const PageSpeedConfigure = () => {
|
|||||||
level="primary"
|
level="primary"
|
||||||
label="Save"
|
label="Save"
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
sx={{ px: theme.gap.large, mt: theme.gap.large }}
|
sx={{ px: theme.spacing(12), mt: theme.spacing(12) }}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -314,33 +338,41 @@ const PageSpeedConfigure = () => {
|
|||||||
disablePortal
|
disablePortal
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
gap={theme.gap.xs}
|
gap={theme.spacing(2)}
|
||||||
sx={{
|
sx={{
|
||||||
position: "absolute",
|
position: "absolute",
|
||||||
top: "50%",
|
top: "50%",
|
||||||
left: "50%",
|
left: "50%",
|
||||||
transform: "translate(-50%, -50%)",
|
transform: "translate(-50%, -50%)",
|
||||||
width: 400,
|
width: 400,
|
||||||
bgcolor: "white",
|
bgcolor: theme.palette.background.main,
|
||||||
border: "solid 1px #f2f2f2",
|
border: 1,
|
||||||
borderRadius: `${theme.shape.borderRadius}px`,
|
borderColor: theme.palette.border.light,
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
boxShadow: 24,
|
boxShadow: 24,
|
||||||
p: "30px",
|
p: theme.spacing(15),
|
||||||
"&:focus": {
|
"&:focus": {
|
||||||
outline: "none",
|
outline: "none",
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography id="modal-delete-pagespeed-monitor" component="h2">
|
<Typography
|
||||||
|
id="modal-delete-pagespeed-monitor"
|
||||||
|
component="h2"
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
Do you really want to delete this monitor?
|
Do you really want to delete this monitor?
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography id="delete-pagespeed-monitor-confirmation">
|
<Typography
|
||||||
|
id="delete-pagespeed-monitor-confirmation"
|
||||||
|
color={theme.palette.text.tertiary}
|
||||||
|
>
|
||||||
Once deleted, this monitor cannot be retrieved.
|
Once deleted, this monitor cannot be retrieved.
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.gap.small}
|
gap={theme.spacing(4)}
|
||||||
mt={theme.gap.large}
|
mt={theme.spacing(12)}
|
||||||
justifyContent="flex-end"
|
justifyContent="flex-end"
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -1,17 +1,3 @@
|
|||||||
.create-page-speed form > .MuiStack-root:not(:last-of-type) {
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
border: solid 1px var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
padding: var(--env-var-font-size-large-plus) var(--env-var-font-size-xlarge);
|
|
||||||
}
|
|
||||||
.create-page-speed h1.MuiTypography-root {
|
|
||||||
font-size: 22px;
|
|
||||||
color: var(--primary-bg);
|
|
||||||
}
|
|
||||||
.create-page-speed p.MuiTypography-root,
|
|
||||||
.create-page-speed h3.MuiTypography-root {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.create-page-speed h1.MuiTypography-root,
|
.create-page-speed h1.MuiTypography-root,
|
||||||
.create-page-speed h3.MuiTypography-root {
|
.create-page-speed h3.MuiTypography-root {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -31,10 +17,10 @@
|
|||||||
.create-page-speed .checkbox-wrapper {
|
.create-page-speed .checkbox-wrapper {
|
||||||
margin-bottom: 1px;
|
margin-bottom: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* to be removed */
|
/* to be removed */
|
||||||
.create-page-speed .section-disabled {
|
.create-page-speed .section-disabled {
|
||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
background-color: #f1f1f2;
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
@@ -45,11 +31,6 @@
|
|||||||
height: var(--env-var-height-2);
|
height: var(--env-var-height-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
body:has(.create-page-speed) .select-dropdown .MuiMenuItem-root,
|
|
||||||
.create-page-speed .select-wrapper .select-component > .MuiSelect-select {
|
|
||||||
text-transform: lowercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
.create-page-speed h3.MuiTypography-root {
|
.create-page-speed h3.MuiTypography-root {
|
||||||
flex: 0.7;
|
flex: 0.7;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ const CreatePageSpeed = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="create-page-speed" gap={theme.gap.mlplus}>
|
<Stack className="create-page-speed" gap={theme.spacing(6)}>
|
||||||
<Breadcrumbs
|
<Breadcrumbs
|
||||||
list={[
|
list={[
|
||||||
{ name: "pagespeed", path: "/pagespeed" },
|
{ name: "pagespeed", path: "/pagespeed" },
|
||||||
@@ -111,11 +111,47 @@ const CreatePageSpeed = () => {
|
|||||||
noValidate
|
noValidate
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
onSubmit={handleCreate}
|
onSubmit={handleCreate}
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
flex={1}
|
flex={1}
|
||||||
>
|
>
|
||||||
<Typography component="h1">Create pagespeed monitor</Typography>
|
<Typography
|
||||||
<Stack gap={theme.gap.xl}>
|
component="h1"
|
||||||
|
lineHeight={1}
|
||||||
|
fontSize={21}
|
||||||
|
color={theme.palette.text.primary}
|
||||||
|
>
|
||||||
|
<Typography
|
||||||
|
component="span"
|
||||||
|
fontSize="inherit"
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
|
Create your{" "}
|
||||||
|
</Typography>
|
||||||
|
<Typography component="span" fontSize="inherit" fontWeight="inherit">
|
||||||
|
pagespeed{" "}
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
component="span"
|
||||||
|
fontSize="inherit"
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
|
monitor
|
||||||
|
</Typography>
|
||||||
|
</Typography>
|
||||||
|
<Stack
|
||||||
|
border={1}
|
||||||
|
borderColor={theme.palette.border.light}
|
||||||
|
borderRadius={theme.shape.borderRadius}
|
||||||
|
backgroundColor={theme.palette.background.main}
|
||||||
|
p={theme.spacing(20)}
|
||||||
|
pl={theme.spacing(15)}
|
||||||
|
gap={theme.spacing(20)}
|
||||||
|
sx={{
|
||||||
|
"& h3, & p": {
|
||||||
|
color: theme.palette.text.secondary,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack direction="row">
|
<Stack direction="row">
|
||||||
<Typography component="h3">Monitor display name</Typography>
|
<Typography component="h3">Monitor display name</Typography>
|
||||||
<Field
|
<Field
|
||||||
@@ -152,8 +188,11 @@ const CreatePageSpeed = () => {
|
|||||||
Incidents notifications{" "}
|
Incidents notifications{" "}
|
||||||
<Typography component="span">(coming soon)</Typography>
|
<Typography component="span">(coming soon)</Typography>
|
||||||
</Typography>
|
</Typography>
|
||||||
<Stack className="section-disabled">
|
<Stack
|
||||||
<Typography mb={theme.gap.small}>
|
className="section-disabled"
|
||||||
|
backgroundColor={theme.palette.background.fill}
|
||||||
|
>
|
||||||
|
<Typography mb={theme.spacing(4)}>
|
||||||
When there is a new incident,
|
When there is a new incident,
|
||||||
</Typography>
|
</Typography>
|
||||||
<Checkbox
|
<Checkbox
|
||||||
@@ -180,7 +219,7 @@ const CreatePageSpeed = () => {
|
|||||||
onChange={() => logger.warn("disabled")}
|
onChange={() => logger.warn("disabled")}
|
||||||
error=""
|
error=""
|
||||||
/>
|
/>
|
||||||
<Typography mt={theme.gap.small}>
|
<Typography mt={theme.spacing(4)}>
|
||||||
You can separate multiple emails with a comma
|
You can separate multiple emails with a comma
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -193,7 +232,7 @@ const CreatePageSpeed = () => {
|
|||||||
level="primary"
|
level="primary"
|
||||||
label="Create"
|
label="Create"
|
||||||
onClick={handleCreate}
|
onClick={handleCreate}
|
||||||
sx={{ px: theme.gap.large, mt: theme.gap.large }}
|
sx={{ px: theme.spacing(12), mt: theme.spacing(12) }}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
.page-speed-details h1 {
|
.page-speed-details h1 {
|
||||||
font-size: var(--env-var-font-size-large-plus);
|
font-size: var(--env-var-font-size-large-plus);
|
||||||
color: var(--primary-color);
|
|
||||||
}
|
}
|
||||||
.page-speed-details h2,
|
.page-speed-details h2,
|
||||||
.page-speed-details h6 {
|
.page-speed-details h6 {
|
||||||
@@ -15,13 +14,7 @@
|
|||||||
.page-speed-details h4 > span {
|
.page-speed-details h4 > span {
|
||||||
font-size: var(--env-var-font-size-small-plus);
|
font-size: var(--env-var-font-size-small-plus);
|
||||||
}
|
}
|
||||||
.page-speed-details h2,
|
|
||||||
.page-speed-details h4,
|
|
||||||
.page-speed-details p {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.page-speed-details h6 {
|
.page-speed-details h6 {
|
||||||
color: var(--theme-main);
|
|
||||||
line-height: 22px;
|
line-height: 22px;
|
||||||
}
|
}
|
||||||
.page-speed-details h1,
|
.page-speed-details h1,
|
||||||
@@ -33,14 +26,6 @@
|
|||||||
height: 34px;
|
height: 34px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.page-speed-details .stat-box,
|
|
||||||
.page-speed-details > .MuiStack-root:last-child,
|
|
||||||
.page-speed-details > .MuiBox-root:nth-last-child(3) {
|
|
||||||
border: solid 1px var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
min-width: 200px;
|
|
||||||
}
|
|
||||||
.page-speed-details .stat-box {
|
.page-speed-details .stat-box {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,17 +29,28 @@ const StatBox = ({ icon, title, value }) => {
|
|||||||
<Stack
|
<Stack
|
||||||
className="stat-box"
|
className="stat-box"
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.gap.small}
|
gap={theme.spacing(4)}
|
||||||
pt={theme.gap.ml}
|
pt={theme.spacing(8)}
|
||||||
px={theme.gap.ml}
|
px={theme.spacing(8)}
|
||||||
pb={theme.gap.mlplus}
|
pb={theme.spacing(10)}
|
||||||
|
border={1}
|
||||||
|
borderColor={theme.palette.border.light}
|
||||||
|
borderRadius={theme.shape.borderRadius}
|
||||||
|
backgroundColor={theme.palette.background.main}
|
||||||
|
minWidth="200px"
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="h6" mb={theme.gap.medium}>
|
<Typography
|
||||||
|
variant="h6"
|
||||||
|
color={theme.palette.common.main}
|
||||||
|
mb={theme.spacing(6)}
|
||||||
|
>
|
||||||
{title}
|
{title}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="h4">{value}</Typography>
|
<Typography variant="h4" color={theme.palette.text.secondary}>
|
||||||
|
{value}
|
||||||
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
@@ -151,7 +162,7 @@ const SkeletonLayout = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Skeleton variant="rounded" width="15%" height={34} />
|
<Skeleton variant="rounded" width="15%" height={34} />
|
||||||
<Stack direction="row" gap={theme.gap.small}>
|
<Stack direction="row" gap={theme.spacing(4)}>
|
||||||
<Skeleton variant="circular" style={{ minWidth: 24, minHeight: 24 }} />
|
<Skeleton variant="circular" style={{ minWidth: 24, minHeight: 24 }} />
|
||||||
<Box width="85%">
|
<Box width="85%">
|
||||||
<Skeleton variant="rounded" width="50%" height={24} />
|
<Skeleton variant="rounded" width="50%" height={24} />
|
||||||
@@ -159,7 +170,7 @@ const SkeletonLayout = () => {
|
|||||||
variant="rounded"
|
variant="rounded"
|
||||||
width="50%"
|
width="50%"
|
||||||
height={18}
|
height={18}
|
||||||
sx={{ mt: theme.gap.small }}
|
sx={{ mt: theme.spacing(4) }}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
@@ -172,7 +183,7 @@ const SkeletonLayout = () => {
|
|||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
gap={theme.gap.xl}
|
gap={theme.spacing(20)}
|
||||||
flexWrap="wrap"
|
flexWrap="wrap"
|
||||||
>
|
>
|
||||||
<Skeleton variant="rounded" width="30%" height={90} sx={{ flex: 1 }} />
|
<Skeleton variant="rounded" width="30%" height={90} sx={{ flex: 1 }} />
|
||||||
@@ -237,10 +248,37 @@ const PageSpeedDetails = () => {
|
|||||||
* @returns {{stroke: string, text: string, bg: string}} The color properties for the given performance value.
|
* @returns {{stroke: string, text: string, bg: string}} The color properties for the given performance value.
|
||||||
*/
|
*/
|
||||||
const getColors = (value) => {
|
const getColors = (value) => {
|
||||||
if (value >= 90 && value <= 100) return theme.pie.green;
|
if (value >= 90 && value <= 100)
|
||||||
else if (value >= 50 && value < 90) return theme.pie.yellow;
|
return {
|
||||||
else if (value >= 0 && value < 50) return theme.pie.red;
|
stroke: theme.palette.success.main,
|
||||||
return theme.pie.default;
|
strokeBg: theme.palette.success.light,
|
||||||
|
text: theme.palette.success.text,
|
||||||
|
bg: theme.palette.success.bg,
|
||||||
|
shape: "circle",
|
||||||
|
};
|
||||||
|
else if (value >= 50 && value < 90)
|
||||||
|
return {
|
||||||
|
stroke: theme.palette.warning.main,
|
||||||
|
strokeBg: theme.palette.warning.bg,
|
||||||
|
text: theme.palette.warning.text,
|
||||||
|
bg: theme.palette.warning.light,
|
||||||
|
shape: "square",
|
||||||
|
};
|
||||||
|
else if (value >= 0 && value < 50)
|
||||||
|
return {
|
||||||
|
stroke: theme.palette.error.text,
|
||||||
|
strokeBg: theme.palette.error.light,
|
||||||
|
text: theme.palette.error.text,
|
||||||
|
bg: theme.palette.error.bg,
|
||||||
|
shape: "circle",
|
||||||
|
};
|
||||||
|
return {
|
||||||
|
stroke: theme.palette.unresolved.main,
|
||||||
|
strokeBg: theme.palette.unresolved.light,
|
||||||
|
text: theme.palette.unresolved.main,
|
||||||
|
bg: theme.palette.unresolved.bg,
|
||||||
|
shape: "",
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -312,8 +350,15 @@ const PageSpeedDetails = () => {
|
|||||||
|
|
||||||
let loading = Object.keys(monitor).length === 0;
|
let loading = Object.keys(monitor).length === 0;
|
||||||
const data = monitor?.checks ? [...monitor.checks].reverse() : [];
|
const data = monitor?.checks ? [...monitor.checks].reverse() : [];
|
||||||
|
|
||||||
|
let sharedStyles = {
|
||||||
|
border: 1,
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<Stack className="page-speed-details" gap={theme.gap.large}>
|
<Stack className="page-speed-details" gap={theme.spacing(12)}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<SkeletonLayout />
|
<SkeletonLayout />
|
||||||
) : (
|
) : (
|
||||||
@@ -324,25 +369,30 @@ const PageSpeedDetails = () => {
|
|||||||
{ name: "details", path: `/pagespeed/${monitorId}` },
|
{ name: "details", path: `/pagespeed/${monitorId}` },
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
<Stack direction="row" gap={theme.gap.xs}>
|
<Stack direction="row" gap={theme.spacing(2)}>
|
||||||
<PulseDot
|
<PulseDot
|
||||||
color={
|
color={
|
||||||
monitor?.status
|
monitor?.status
|
||||||
? theme.label.up.dotColor
|
? theme.palette.success.main
|
||||||
: theme.label.down.dotColor
|
: theme.palette.error.main
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography
|
<Typography
|
||||||
component="h1"
|
component="h1"
|
||||||
mb={theme.gap.xs}
|
mb={theme.spacing(2)}
|
||||||
|
color={theme.palette.text.primary}
|
||||||
sx={{ lineHeight: 1 }}
|
sx={{ lineHeight: 1 }}
|
||||||
>
|
>
|
||||||
{monitor?.url}
|
{monitor?.url}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
sx={{ color: "var(--success-color)" }}
|
color={
|
||||||
|
monitor?.status
|
||||||
|
? theme.palette.success.main
|
||||||
|
: theme.palette.error.text
|
||||||
|
}
|
||||||
>
|
>
|
||||||
Your pagespeed monitor is live.
|
Your pagespeed monitor is live.
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -353,15 +403,18 @@ const PageSpeedDetails = () => {
|
|||||||
animate="rotate90"
|
animate="rotate90"
|
||||||
img={
|
img={
|
||||||
<SettingsIcon
|
<SettingsIcon
|
||||||
style={{ width: theme.gap.mlplus, height: theme.gap.mlplus }}
|
style={{
|
||||||
|
width: theme.spacing(10),
|
||||||
|
height: theme.spacing(10),
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
onClick={() => navigate(`/pagespeed/configure/${monitorId}`)}
|
onClick={() => navigate(`/pagespeed/configure/${monitorId}`)}
|
||||||
sx={{
|
sx={{
|
||||||
ml: "auto",
|
ml: "auto",
|
||||||
alignSelf: "flex-end",
|
alignSelf: "flex-end",
|
||||||
backgroundColor: theme.palette.otherColors.fillGray,
|
backgroundColor: theme.palette.background.fill,
|
||||||
px: theme.gap.medium,
|
px: theme.spacing(6),
|
||||||
"& svg": {
|
"& svg": {
|
||||||
mr: "6px",
|
mr: "6px",
|
||||||
},
|
},
|
||||||
@@ -371,7 +424,7 @@ const PageSpeedDetails = () => {
|
|||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
flexWrap="wrap"
|
flexWrap="wrap"
|
||||||
>
|
>
|
||||||
<StatBox
|
<StatBox
|
||||||
@@ -412,19 +465,39 @@ const PageSpeedDetails = () => {
|
|||||||
value={formatDurationRounded(monitor?.interval)}
|
value={formatDurationRounded(monitor?.interval)}
|
||||||
></StatBox>
|
></StatBox>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Typography component="h2">Score history</Typography>
|
<Typography component="h2" color={theme.palette.text.secondary}>
|
||||||
<Box height="300px">
|
Score history
|
||||||
|
</Typography>
|
||||||
|
<Box
|
||||||
|
height="300px"
|
||||||
|
sx={{
|
||||||
|
...sharedStyles,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<PageSpeedLineChart pageSpeedChecks={data} />
|
<PageSpeedLineChart pageSpeedChecks={data} />
|
||||||
</Box>
|
</Box>
|
||||||
<Typography component="h2">Performance report</Typography>
|
<Typography component="h2" color={theme.palette.text.secondary}>
|
||||||
<Stack direction="row" alignItems="center" overflow="hidden" flex={1}>
|
Performance report
|
||||||
|
</Typography>
|
||||||
|
<Stack
|
||||||
|
direction="row"
|
||||||
|
alignItems="center"
|
||||||
|
overflow="hidden"
|
||||||
|
flex={1}
|
||||||
|
sx={{
|
||||||
|
"& p": {
|
||||||
|
color: theme.palette.text.secondary,
|
||||||
|
},
|
||||||
|
...sharedStyles,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack
|
<Stack
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
minWidth="300px"
|
minWidth="300px"
|
||||||
flex={1}
|
flex={1}
|
||||||
px={theme.gap.xl}
|
px={theme.spacing(20)}
|
||||||
py={theme.gap.ml}
|
py={theme.spacing(8)}
|
||||||
>
|
>
|
||||||
<Box onMouseLeave={() => setExpand(false)}>
|
<Box onMouseLeave={() => setExpand(false)}>
|
||||||
{expand ? (
|
{expand ? (
|
||||||
@@ -514,12 +587,12 @@ const PageSpeedDetails = () => {
|
|||||||
</PieChart>
|
</PieChart>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Typography mt={theme.gap.medium}>
|
<Typography mt={theme.spacing(6)}>
|
||||||
Values are estimated and may vary.{" "}
|
Values are estimated and may vary.{" "}
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
sx={{
|
sx={{
|
||||||
color: theme.palette.primary.main,
|
color: theme.palette.common.main,
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
textDecoration: "underline",
|
textDecoration: "underline",
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
@@ -530,21 +603,23 @@ const PageSpeedDetails = () => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Box
|
<Box
|
||||||
px={theme.gap.xl}
|
px={theme.spacing(20)}
|
||||||
py={theme.gap.ml}
|
py={theme.spacing(8)}
|
||||||
height="100%"
|
height="100%"
|
||||||
flex={1}
|
flex={1}
|
||||||
sx={{
|
sx={{
|
||||||
borderLeft: `solid 1px ${theme.palette.otherColors.graishWhite}`,
|
borderLeft: 1,
|
||||||
|
borderLeftColor: theme.palette.border.light,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
mb={theme.gap.medium}
|
mb={theme.spacing(6)}
|
||||||
pb={theme.gap.ml}
|
pb={theme.spacing(8)}
|
||||||
color={theme.palette.secondary.main}
|
color={theme.palette.text.secondary}
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
sx={{
|
sx={{
|
||||||
borderBottom: `solid 1px ${theme.palette.otherColors.graishWhite}`,
|
borderBottom: 1,
|
||||||
|
borderBottomColor: theme.palette.border.light,
|
||||||
borderBottomStyle: "dashed",
|
borderBottomStyle: "dashed",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -552,7 +627,7 @@ const PageSpeedDetails = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
sx={{
|
sx={{
|
||||||
color: theme.palette.primary.main,
|
color: theme.palette.common.main,
|
||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
textDecoration: "underline",
|
textDecoration: "underline",
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
@@ -569,8 +644,8 @@ const PageSpeedDetails = () => {
|
|||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
flexWrap="wrap"
|
flexWrap="wrap"
|
||||||
pt={theme.gap.ml}
|
pt={theme.spacing(8)}
|
||||||
gap={theme.gap.ml}
|
gap={theme.spacing(8)}
|
||||||
>
|
>
|
||||||
{Object.keys(audits).map((key) => {
|
{Object.keys(audits).map((key) => {
|
||||||
if (key === "_id") return;
|
if (key === "_id") return;
|
||||||
@@ -581,8 +656,8 @@ const PageSpeedDetails = () => {
|
|||||||
let shape = (
|
let shape = (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
width: theme.gap.medium,
|
width: theme.spacing(6),
|
||||||
height: theme.gap.medium,
|
height: theme.spacing(6),
|
||||||
borderRadius: "50%",
|
borderRadius: "50%",
|
||||||
backgroundColor: metricParams.stroke,
|
backgroundColor: metricParams.stroke,
|
||||||
}}
|
}}
|
||||||
@@ -592,8 +667,8 @@ const PageSpeedDetails = () => {
|
|||||||
shape = (
|
shape = (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
width: theme.gap.medium,
|
width: theme.spacing(6),
|
||||||
height: theme.gap.medium,
|
height: theme.spacing(6),
|
||||||
backgroundColor: metricParams.stroke,
|
backgroundColor: metricParams.stroke,
|
||||||
}}
|
}}
|
||||||
></Box>
|
></Box>
|
||||||
@@ -604,10 +679,14 @@ const PageSpeedDetails = () => {
|
|||||||
sx={{
|
sx={{
|
||||||
width: 0,
|
width: 0,
|
||||||
height: 0,
|
height: 0,
|
||||||
ml: `calc((${theme.gap.medium} - ${theme.gap.small}) / -2)`,
|
ml: `calc((${theme.spacing(6)} - ${theme.spacing(
|
||||||
borderLeft: `${theme.gap.small} solid transparent`,
|
4
|
||||||
borderRight: `${theme.gap.small} solid transparent`,
|
)}) / -2)`,
|
||||||
borderBottom: `${theme.gap.medium} solid ${metricParams.stroke}`,
|
borderLeft: `${theme.spacing(4)} solid transparent`,
|
||||||
|
borderRight: `${theme.spacing(4)} solid transparent`,
|
||||||
|
borderBottom: `${theme.spacing(6)} solid ${
|
||||||
|
metricParams.stroke
|
||||||
|
}`,
|
||||||
}}
|
}}
|
||||||
></Box>
|
></Box>
|
||||||
);
|
);
|
||||||
@@ -630,7 +709,7 @@ const PageSpeedDetails = () => {
|
|||||||
className="metric"
|
className="metric"
|
||||||
key={`${key}-box`}
|
key={`${key}-box`}
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.gap.small}
|
gap={theme.spacing(4)}
|
||||||
>
|
>
|
||||||
{shape}
|
{shape}
|
||||||
<Box>
|
<Box>
|
||||||
@@ -650,8 +729,8 @@ const PageSpeedDetails = () => {
|
|||||||
component="span"
|
component="span"
|
||||||
ml="2px"
|
ml="2px"
|
||||||
sx={{
|
sx={{
|
||||||
color: theme.palette.secondary.main,
|
color: theme.palette.text.secondary,
|
||||||
fontSize: "13px",
|
fontSize: 13,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{unit}
|
{unit}
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
.page-speed h1.MuiTypography-root,
|
|
||||||
.page-speed span.MuiTypography-root,
|
|
||||||
.page-speed p.MuiTypography-root {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.page-speed h2.MuiTypography-root {
|
.page-speed h2.MuiTypography-root {
|
||||||
color: var(--theme-main);
|
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
}
|
}
|
||||||
.page-speed h1.MuiTypography-root,
|
.page-speed h1.MuiTypography-root,
|
||||||
@@ -19,11 +13,6 @@
|
|||||||
.page-speed p.MuiTypography-root > span.MuiTypography-root {
|
.page-speed p.MuiTypography-root > span.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-small-plus);
|
font-size: var(--env-var-font-size-small-plus);
|
||||||
}
|
}
|
||||||
.page-speed .MuiGrid-item > .MuiStack-root {
|
|
||||||
border: solid 1px var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
}
|
|
||||||
.page-speed .label {
|
.page-speed .label {
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
|
|||||||
@@ -30,15 +30,25 @@ const Card = ({ data }) => {
|
|||||||
>
|
>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
gap={theme.gap.medium}
|
gap={theme.spacing(6)}
|
||||||
p={theme.gap.ml}
|
p={theme.spacing(8)}
|
||||||
onClick={() => navigate(`/pagespeed/${data._id}`)}
|
onClick={() => navigate(`/pagespeed/${data._id}`)}
|
||||||
|
border={1}
|
||||||
|
borderColor={theme.palette.border.light}
|
||||||
|
borderRadius={theme.shape.borderRadius}
|
||||||
|
backgroundColor={theme.palette.background.main}
|
||||||
sx={{ cursor: "pointer" }}
|
sx={{ cursor: "pointer" }}
|
||||||
>
|
>
|
||||||
<PageSpeedIcon style={{ width: theme.gap.ml, height: theme.gap.ml }} />
|
<PageSpeedIcon
|
||||||
|
style={{ width: theme.spacing(8), height: theme.spacing(8) }}
|
||||||
|
/>
|
||||||
<Box flex={1}>
|
<Box flex={1}>
|
||||||
<Stack direction="row" justifyContent="space-between">
|
<Stack direction="row" justifyContent="space-between">
|
||||||
<Typography component="h2" mb={theme.gap.xs}>
|
<Typography
|
||||||
|
component="h2"
|
||||||
|
mb={theme.spacing(2)}
|
||||||
|
color={theme.palette.common.main}
|
||||||
|
>
|
||||||
{data.name}
|
{data.name}
|
||||||
</Typography>
|
</Typography>
|
||||||
<StatusLabel
|
<StatusLabel
|
||||||
@@ -47,7 +57,7 @@ const Card = ({ data }) => {
|
|||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Typography>{data.url.replace(/^https?:\/\//, "")}</Typography>
|
<Typography>{data.url.replace(/^https?:\/\//, "")}</Typography>
|
||||||
<Typography mt={theme.gap.large}>
|
<Typography mt={theme.spacing(12)}>
|
||||||
<Typography component="span" fontWeight={600}>
|
<Typography component="span" fontWeight={600}>
|
||||||
Last checked:{" "}
|
Last checked:{" "}
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -75,11 +85,11 @@ const SkeletonLayout = () => {
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack gap={theme.gap.xs}>
|
<Stack gap={theme.spacing(2)}>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
mb={theme.gap.large}
|
mb={theme.spacing(12)}
|
||||||
>
|
>
|
||||||
<Box width="80%">
|
<Box width="80%">
|
||||||
<Skeleton variant="rounded" width="25%" height={24} />
|
<Skeleton variant="rounded" width="25%" height={24} />
|
||||||
@@ -87,7 +97,7 @@ const SkeletonLayout = () => {
|
|||||||
variant="rounded"
|
variant="rounded"
|
||||||
width="50%"
|
width="50%"
|
||||||
height={19.5}
|
height={19.5}
|
||||||
sx={{ mt: theme.gap.xs }}
|
sx={{ mt: theme.spacing(2) }}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
@@ -97,7 +107,7 @@ const SkeletonLayout = () => {
|
|||||||
sx={{ alignSelf: "flex-end" }}
|
sx={{ alignSelf: "flex-end" }}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="row" flexWrap="wrap" gap={theme.gap.large}>
|
<Stack direction="row" flexWrap="wrap" gap={theme.spacing(12)}>
|
||||||
<Skeleton
|
<Skeleton
|
||||||
variant="rounded"
|
variant="rounded"
|
||||||
width="100%"
|
width="100%"
|
||||||
@@ -163,15 +173,22 @@ const PageSpeed = ({ isAdmin }) => {
|
|||||||
{isActuallyLoading ? (
|
{isActuallyLoading ? (
|
||||||
<SkeletonLayout />
|
<SkeletonLayout />
|
||||||
) : monitors?.length !== 0 ? (
|
) : monitors?.length !== 0 ? (
|
||||||
<Stack gap={theme.gap.xs}>
|
<Stack
|
||||||
|
gap={theme.spacing(2)}
|
||||||
|
sx={{
|
||||||
|
"& h1, & span.MuiTypography-root, & p": {
|
||||||
|
color: theme.palette.text.secondary,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
mb={theme.gap.large}
|
mb={theme.spacing(12)}
|
||||||
>
|
>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h1">All page speed monitors</Typography>
|
<Typography component="h1">All page speed monitors</Typography>
|
||||||
<Typography mt={theme.gap.xs}>
|
<Typography mt={theme.spacing(2)}>
|
||||||
Click on one of the monitors to get more site speed information.
|
Click on one of the monitors to get more site speed information.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
@@ -181,7 +198,7 @@ const PageSpeed = ({ isAdmin }) => {
|
|||||||
onClick={() => navigate("/pagespeed/create")}
|
onClick={() => navigate("/pagespeed/create")}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Grid container spacing={theme.gap.large}>
|
<Grid container spacing={theme.spacing(12)}>
|
||||||
{monitors?.map((monitor) => (
|
{monitors?.map((monitor) => (
|
||||||
<Card data={monitor} key={`monitor-${monitor._id}`} />
|
<Card data={monitor} key={`monitor-${monitor._id}`} />
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -53,7 +53,12 @@ const theme = createTheme({
|
|||||||
light: "#ffffff",
|
light: "#ffffff",
|
||||||
border: "#D0D5DD",
|
border: "#D0D5DD",
|
||||||
},
|
},
|
||||||
success: { main: "#17b26a", light: "#d4f4e1", bg: "#ecfdf3" },
|
success: {
|
||||||
|
text: "#079455",
|
||||||
|
main: "#17b26a",
|
||||||
|
light: "#d4f4e1",
|
||||||
|
bg: "#ecfdf3",
|
||||||
|
},
|
||||||
error: {
|
error: {
|
||||||
text: "#f04438",
|
text: "#f04438",
|
||||||
main: "#d32f2f",
|
main: "#d32f2f",
|
||||||
|
|||||||
Reference in new issue
Block a user