Merge pull request #532 from bluewave-labs/feat/create-pagespeed
Updated create page speed monitor page
This commit is contained in:
8 files changed
+142
-124
No files matched your search
@@ -3,23 +3,22 @@
|
|||||||
height: var(--env-var-img-width-2);
|
height: var(--env-var-img-width-2);
|
||||||
color: var(--env-var-color-5);
|
color: var(--env-var-color-5);
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
margin-bottom: 2px;
|
|
||||||
}
|
}
|
||||||
.MuiTable-root .host a svg {
|
.MuiTable-root .host a svg {
|
||||||
width: var(--env-var-font-size-large);
|
width: var(--env-var-font-size-large);
|
||||||
height: var(--env-var-font-size-large);
|
height: var(--env-var-font-size-large);
|
||||||
}
|
}
|
||||||
.MuiTable-root .host div:nth-child(3) {
|
|
||||||
font-size: var(--env-var-font-size-small);
|
|
||||||
}
|
|
||||||
.MuiTable-root .host div:nth-child(2) {
|
.MuiTable-root .host div:nth-child(2) {
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
margin-right: 10px;
|
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
.MuiTable-root .host div:nth-child(2) span {
|
||||||
|
font-size: var(--env-var-font-size-small);
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.MuiTable-root .label {
|
.MuiTable-root .label {
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
|||||||
@@ -145,7 +145,10 @@ function NavBar() {
|
|||||||
</IconButton>
|
</IconButton>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Menu
|
<Menu
|
||||||
sx={{ mt: theme.spacing(5.5) }}
|
sx={{
|
||||||
|
mt: theme.spacing(5.5),
|
||||||
|
borderRadius: "4px",
|
||||||
|
}}
|
||||||
id="menu-appbar"
|
id="menu-appbar"
|
||||||
anchorEl={anchorElUser}
|
anchorEl={anchorElUser}
|
||||||
anchorOrigin={{
|
anchorOrigin={{
|
||||||
@@ -172,6 +175,7 @@ function NavBar() {
|
|||||||
fontSize="var(--env-var-font-size-medium)"
|
fontSize="var(--env-var-font-size-medium)"
|
||||||
textAlign="center"
|
textAlign="center"
|
||||||
marginLeft="8px"
|
marginLeft="8px"
|
||||||
|
sx={{ fontWeight: 400, color: "#344054" }}
|
||||||
>
|
>
|
||||||
{setting}
|
{setting}
|
||||||
</Typography>
|
</Typography>
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ body:has(.monitors) .actions-menu li.MuiButtonBase-root {
|
|||||||
body:has(.monitors) .actions-menu li.MuiButtonBase-root:last-of-type {
|
body:has(.monitors) .actions-menu li.MuiButtonBase-root:last-of-type {
|
||||||
color: var(--env-var-color-26);
|
color: var(--env-var-color-26);
|
||||||
}
|
}
|
||||||
body:has(.monitors) .MuiModal-root p.MuiTypography-root {
|
body:has(.monitors) .actions-menu .MuiModal-root p.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-medium);
|
font-size: var(--env-var-font-size-medium);
|
||||||
color: var(--env-var-color-2);
|
color: var(--env-var-color-2);
|
||||||
}
|
}
|
||||||
@@ -44,8 +44,12 @@ const Host = ({ params }) => {
|
|||||||
<a href={params.url} target="_blank" rel="noreferrer">
|
<a href={params.url} target="_blank" rel="noreferrer">
|
||||||
<OpenInNewPage />
|
<OpenInNewPage />
|
||||||
</a>
|
</a>
|
||||||
<Box>{params.title}</Box>
|
<Box>
|
||||||
<Box sx={{ color: params.percentageColor }}>{params.precentage}%</Box>
|
{params.title}
|
||||||
|
<Typography component="span" sx={{ color: params.percentageColor }}>
|
||||||
|
{params.precentage}%
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,37 +1,31 @@
|
|||||||
.create-page-speed form {
|
.create-page-speed form > .MuiStack-root:not(:last-of-type) {
|
||||||
position: relative;
|
|
||||||
margin: auto;
|
|
||||||
margin-top: var(--env-var-default-2);
|
|
||||||
background-color: var(--env-var-color-8);
|
background-color: var(--env-var-color-8);
|
||||||
width: 100%;
|
border: solid 1px var(--env-var-color-6);
|
||||||
max-width: 500px;
|
|
||||||
box-shadow: var(--env-var-shadow-1);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
border-radius: var(--env-var-radius-1);
|
||||||
padding: var(--env-var-default-2);
|
padding: var(--env-var-default-2);
|
||||||
}
|
}
|
||||||
.create-page-speed h1.MuiTypography-root,
|
.create-page-speed h1.MuiTypography-root {
|
||||||
.create-page-speed h2.MuiTypography-root,
|
font-size: var(--env-var-font-size-large);
|
||||||
|
color: var(--env-var-color-1);
|
||||||
|
}
|
||||||
.create-page-speed p.MuiTypography-root,
|
.create-page-speed p.MuiTypography-root,
|
||||||
.create-page-speed h2.MuiTypography-root > span.MuiTypography-root {
|
.create-page-speed h3.MuiTypography-root {
|
||||||
color: var(--env-var-color-5);
|
color: var(--env-var-color-5);
|
||||||
}
|
}
|
||||||
.create-page-speed h1.MuiTypography-root,
|
.create-page-speed h1.MuiTypography-root,
|
||||||
.create-page-speed h2.MuiTypography-root {
|
.create-page-speed h3.MuiTypography-root {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.create-page-speed h2.MuiTypography-root {
|
|
||||||
font-size: var(--env-var-font-size-medium-plus);
|
|
||||||
}
|
|
||||||
.create-page-speed p.MuiTypography-root,
|
.create-page-speed p.MuiTypography-root,
|
||||||
.create-page-speed button,
|
.create-page-speed h3.MuiTypography-root,
|
||||||
.create-page-speed h2.MuiTypography-root > span.MuiTypography-root {
|
.create-page-speed h3.MuiTypography-root > span.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-medium);
|
font-size: var(--env-var-font-size-medium);
|
||||||
}
|
}
|
||||||
.create-page-speed .MuiBox-root > .field + p.MuiTypography-root {
|
.create-page-speed .MuiBox-root > .field + p.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-small-plus);
|
font-size: var(--env-var-font-size-small-plus);
|
||||||
}
|
}
|
||||||
.create-page-speed .MuiBox-root > .field + p.MuiTypography-root,
|
.create-page-speed .MuiBox-root > .field + p.MuiTypography-root,
|
||||||
.create-page-speed h2.MuiTypography-root > span.MuiTypography-root {
|
.create-page-speed h3.MuiTypography-root > span.MuiTypography-root {
|
||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
}
|
}
|
||||||
.create-page-speed .checkbox-wrapper {
|
.create-page-speed .checkbox-wrapper {
|
||||||
@@ -47,17 +41,18 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.create-page-speed button:not(.MuiIconButton-root) {
|
.create-page-speed button {
|
||||||
height: var(--env-var-height-2);
|
height: var(--env-var-height-2);
|
||||||
}
|
}
|
||||||
.create-page-speed .MuiIconButton-root {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
margin: var(--env-var-spacing-1);
|
|
||||||
}
|
|
||||||
|
|
||||||
body:has(.create-page-speed) .select-dropdown .MuiMenuItem-root,
|
body:has(.create-page-speed) .select-dropdown .MuiMenuItem-root,
|
||||||
.create-page-speed .select-wrapper .select-component > .MuiSelect-select {
|
.create-page-speed .select-wrapper .select-component > .MuiSelect-select {
|
||||||
text-transform: lowercase;
|
text-transform: lowercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.create-page-speed .field,
|
||||||
|
.create-page-speed .section-disabled,
|
||||||
|
.create-page-speed .select-wrapper,
|
||||||
|
.create-page-speed h3.MuiTypography-root {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
import { Box, IconButton, Stack, Typography } from "@mui/material";
|
import { Box, Stack, Typography } from "@mui/material";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useDispatch, useSelector } from "react-redux";
|
import { useDispatch, useSelector } from "react-redux";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import CloseRoundedIcon from "@mui/icons-material/CloseRounded";
|
|
||||||
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 Button from "../../../Components/Button";
|
import Button from "../../../Components/Button";
|
||||||
@@ -11,6 +10,7 @@ import Checkbox from "../../../Components/Inputs/Checkbox";
|
|||||||
import { monitorValidation } from "../../../Validation/validation";
|
import { monitorValidation } from "../../../Validation/validation";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
import { createPageSpeed } from "../../../Features/PageSpeedMonitor/pageSpeedMonitorSlice";
|
import { createPageSpeed } from "../../../Features/PageSpeedMonitor/pageSpeedMonitorSlice";
|
||||||
|
import WestRoundedIcon from "@mui/icons-material/WestRounded";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
const CreatePageSpeed = () => {
|
const CreatePageSpeed = () => {
|
||||||
@@ -23,10 +23,11 @@ const CreatePageSpeed = () => {
|
|||||||
|
|
||||||
const frequencies = [
|
const frequencies = [
|
||||||
{ _id: 1, name: "1 minute" },
|
{ _id: 1, name: "1 minute" },
|
||||||
{ _id: 2, name: "2 minutes" },
|
{ _id: 1440, name: "1 day" },
|
||||||
{ _id: 3, name: "3 minutes" },
|
{ _id: 2880, name: "2 days" },
|
||||||
{ _id: 4, name: "4 minutes" },
|
{ _id: 4320, name: "3 days" },
|
||||||
{ _id: 5, name: "5 minutes" },
|
{ _id: 7200, name: "5 days" },
|
||||||
|
{ _id: 10080, name: "1 week" },
|
||||||
];
|
];
|
||||||
|
|
||||||
const [form, setForm] = useState({
|
const [form, setForm] = useState({
|
||||||
@@ -96,102 +97,114 @@ const CreatePageSpeed = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box className="create-page-speed">
|
<Box className="create-page-speed">
|
||||||
|
<Button
|
||||||
|
level="tertiary"
|
||||||
|
label="Back"
|
||||||
|
animate="slideLeft"
|
||||||
|
img={<WestRoundedIcon />}
|
||||||
|
onClick={() => navigate("/page-speed")}
|
||||||
|
sx={{
|
||||||
|
backgroundColor: "#f4f4f4",
|
||||||
|
mb: theme.gap.large,
|
||||||
|
px: theme.gap.ml,
|
||||||
|
"& svg.MuiSvgIcon-root": {
|
||||||
|
mr: theme.gap.small,
|
||||||
|
fill: theme.palette.otherColors.slateGray,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<form
|
<form
|
||||||
noValidate
|
noValidate
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
onSubmit={handleCreate}
|
onSubmit={handleCreate}
|
||||||
style={{ display: "flex", flexDirection: "column", gap: theme.gap.xl }}
|
style={{
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "column",
|
||||||
|
gap: theme.gap.large,
|
||||||
|
// TODO
|
||||||
|
maxWidth: "1000px",
|
||||||
|
}}
|
||||||
>
|
>
|
||||||
<IconButton
|
<Typography component="h1">Create a page speed monitor</Typography>
|
||||||
aria-label="close modal"
|
<Stack gap={theme.gap.xl}>
|
||||||
onClick={() => navigate("/page-speed")}
|
<Stack direction="row">
|
||||||
sx={{
|
<Typography component="h3">Monitor friendly name</Typography>
|
||||||
p: "5px",
|
<Field
|
||||||
opacity: 0.6,
|
type="text"
|
||||||
"&:focus": { outline: "none" },
|
id="monitor-name"
|
||||||
}}
|
placeholder="Example monitor"
|
||||||
>
|
value={form.name}
|
||||||
<CloseRoundedIcon />
|
onChange={(event) => handleChange(event, "name")}
|
||||||
</IconButton>
|
error={errors.name}
|
||||||
<Stack gap={theme.gap.large}>
|
/>
|
||||||
<Typography component="h1">Create a page speed monitor</Typography>
|
</Stack>
|
||||||
<Field
|
<Stack direction="row">
|
||||||
type="text"
|
<Typography component="h3">URL</Typography>
|
||||||
id="monitor-name"
|
<Field
|
||||||
label="Monitor friendly name"
|
type="url"
|
||||||
placeholder="Example monitor"
|
id="monitor-url"
|
||||||
isOptional={true}
|
placeholder="random.website.com"
|
||||||
value={form.name}
|
value={form.url}
|
||||||
onChange={(event) => handleChange(event, "name")}
|
onChange={(event) => handleChange(event, "url")}
|
||||||
error={errors.name}
|
error={errors.url}
|
||||||
/>
|
/>
|
||||||
<Field
|
</Stack>
|
||||||
type="url"
|
<Stack direction="row">
|
||||||
id="monitor-url"
|
<Typography component="h3">Check frequency</Typography>
|
||||||
label="URL"
|
<Select
|
||||||
placeholder="random.website.com"
|
id="monitor-frequency"
|
||||||
value={form.url}
|
items={frequencies}
|
||||||
onChange={(event) => handleChange(event, "url")}
|
value={form.interval}
|
||||||
error={errors.url}
|
onChange={(event) => handleChange(event, "interval")}
|
||||||
/>
|
/>
|
||||||
<Select
|
</Stack>
|
||||||
id="monitor-frequency"
|
<Stack direction="row">
|
||||||
label="Check frequency"
|
<Typography component="h3">
|
||||||
items={frequencies}
|
Incidents notifications{" "}
|
||||||
value={form.interval}
|
<Typography component="span">(coming soon)</Typography>
|
||||||
onChange={(event) => handleChange(event, "interval")}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
<Stack gap={theme.gap.small}>
|
|
||||||
<Typography component="h2">
|
|
||||||
Incidents notifications{" "}
|
|
||||||
<Typography component="span">(coming soon)</Typography>
|
|
||||||
</Typography>
|
|
||||||
<Box className="section-disabled">
|
|
||||||
<Typography mb={theme.gap.small}>
|
|
||||||
When there is a new incident,
|
|
||||||
</Typography>
|
</Typography>
|
||||||
<Checkbox
|
<Stack className="section-disabled">
|
||||||
id="notify-sms"
|
<Typography mb={theme.gap.small}>
|
||||||
label="Notify via SMS (coming soon)"
|
When there is a new incident,
|
||||||
isChecked={false}
|
|
||||||
isDisabled={true}
|
|
||||||
/>
|
|
||||||
<Checkbox
|
|
||||||
id="notify-email"
|
|
||||||
label="Notify via email (to gorkem.cetin@bluewavelabs.ca)"
|
|
||||||
isChecked={false}
|
|
||||||
/>
|
|
||||||
<Checkbox
|
|
||||||
id="notify-emails"
|
|
||||||
label="Notify via email to following emails"
|
|
||||||
isChecked={false}
|
|
||||||
/>
|
|
||||||
<Box mx={`calc(${theme.gap.ml} * 2)`}>
|
|
||||||
<Field
|
|
||||||
id="notify-emails-list"
|
|
||||||
placeholder="notifications@gmail.com"
|
|
||||||
value=""
|
|
||||||
onChange={() => console.log("disabled")}
|
|
||||||
error=""
|
|
||||||
/>
|
|
||||||
<Typography mt={theme.gap.small}>
|
|
||||||
You can separate multiple emails with a comma
|
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
<Checkbox
|
||||||
</Box>
|
id="notify-sms"
|
||||||
|
label="Notify via SMS (coming soon)"
|
||||||
|
isChecked={false}
|
||||||
|
isDisabled={true}
|
||||||
|
/>
|
||||||
|
<Checkbox
|
||||||
|
id="notify-email"
|
||||||
|
label="Notify via email (to gorkem.cetin@bluewavelabs.ca)"
|
||||||
|
isChecked={false}
|
||||||
|
/>
|
||||||
|
<Checkbox
|
||||||
|
id="notify-emails"
|
||||||
|
label="Notify via email to following emails"
|
||||||
|
isChecked={false}
|
||||||
|
/>
|
||||||
|
<Box mx={`calc(${theme.gap.ml} * 2)`}>
|
||||||
|
<Field
|
||||||
|
id="notify-emails-list"
|
||||||
|
placeholder="notifications@gmail.com"
|
||||||
|
value=""
|
||||||
|
onChange={() => console.log("disabled")}
|
||||||
|
error=""
|
||||||
|
/>
|
||||||
|
<Typography mt={theme.gap.small}>
|
||||||
|
You can separate multiple emails with a comma
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack direction="row" justifyContent="flex-end" gap={theme.gap.small}>
|
<Stack direction="row" justifyContent="flex-end">
|
||||||
<Button
|
|
||||||
level="tertiary"
|
|
||||||
label="Cancel"
|
|
||||||
onClick={() => navigate("/page-speed")}
|
|
||||||
/>
|
|
||||||
<Button
|
<Button
|
||||||
type="submit"
|
type="submit"
|
||||||
level="primary"
|
level="primary"
|
||||||
label="Create"
|
label="Create"
|
||||||
onClick={handleCreate}
|
onClick={handleCreate}
|
||||||
|
sx={{ px: theme.gap.large, mt: theme.gap.large }}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -29,7 +29,10 @@
|
|||||||
height: 22px;
|
height: 22px;
|
||||||
font-size: var(--env-var-font-size-small);
|
font-size: var(--env-var-font-size-small);
|
||||||
}
|
}
|
||||||
.page-speed button {
|
.page-speed:not(:has([class*="fallback__"])) button {
|
||||||
height: 34px;
|
height: 34px;
|
||||||
align-self: flex-end;
|
align-self: flex-end;
|
||||||
}
|
}
|
||||||
|
.page-speed [class*="fallback__"] h1 {
|
||||||
|
margin-left: var(--env-var-spacing-3);
|
||||||
|
}
|
||||||
@@ -75,7 +75,7 @@ const PageSpeed = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box className="page-speed">
|
<Box className="page-speed">
|
||||||
{monitors ? (
|
{monitors?.length !== 0 ? (
|
||||||
<Stack gap={theme.gap.xs}>
|
<Stack gap={theme.gap.xs}>
|
||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
|
|||||||
Reference in new issue
Block a user