Refactored pages styling 2/3
This commit is contained in:
1 parent
b34a17004b
commit
05ffb3d270
20 files changed
+294
-177
No files matched your search
+2
-1
@@ -34,6 +34,7 @@ function App() {
|
|||||||
const MonitorsWithAdminProp = withAdminProp(Monitors);
|
const MonitorsWithAdminProp = withAdminProp(Monitors);
|
||||||
const DetailsWithAdminProp = withAdminProp(Details);
|
const DetailsWithAdminProp = withAdminProp(Details);
|
||||||
const PageSpeedWithAdminProp = withAdminProp(PageSpeed);
|
const PageSpeedWithAdminProp = withAdminProp(PageSpeed);
|
||||||
|
const MaintenanceWithAdminProp = withAdminProp(Maintenance);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Routes>
|
<Routes>
|
||||||
@@ -74,7 +75,7 @@ function App() {
|
|||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="maintenance"
|
path="maintenance"
|
||||||
element={<ProtectedRoute Component={Maintenance} />}
|
element={<ProtectedRoute Component={MaintenanceWithAdminProp} />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="/maintenance/create"
|
path="/maintenance/create"
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const Fallback = ({ title, checks, link = "/", isAdmin }) => {
|
|||||||
marginY={theme.spacing(6)}
|
marginY={theme.spacing(6)}
|
||||||
color={theme.palette.text.secondary}
|
color={theme.palette.text.secondary}
|
||||||
>
|
>
|
||||||
A {title} monitor is used to:
|
A {title} is used to:
|
||||||
</Typography>
|
</Typography>
|
||||||
{checks.map((check, index) => (
|
{checks.map((check, index) => (
|
||||||
<Check
|
<Check
|
||||||
@@ -50,6 +50,7 @@ const Fallback = ({ title, checks, link = "/", isAdmin }) => {
|
|||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
|
{/* TODO - display a different fallback if user is not an admin*/}
|
||||||
{isAdmin && (
|
{isAdmin && (
|
||||||
<Button
|
<Button
|
||||||
level="primary"
|
level="primary"
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ const ForgotPassword = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Box
|
<Box
|
||||||
component="form"
|
component="form"
|
||||||
width="100%"
|
width="95%"
|
||||||
textAlign="left"
|
textAlign="left"
|
||||||
noValidate
|
noValidate
|
||||||
spellCheck={false}
|
spellCheck={false}
|
||||||
@@ -185,6 +185,7 @@ const ForgotPassword = () => {
|
|||||||
<Typography display="inline-block">Go back to —</Typography>
|
<Typography display="inline-block">Go back to —</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
|
color={theme.palette.common.main}
|
||||||
ml={theme.spacing(2)}
|
ml={theme.spacing(2)}
|
||||||
onClick={handleNavigate}
|
onClick={handleNavigate}
|
||||||
sx={{ userSelect: "none" }}
|
sx={{ userSelect: "none" }}
|
||||||
|
|||||||
@@ -275,6 +275,7 @@ const StepTwo = ({ form, errors, onSubmit, onChange, onBack }) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
component="span"
|
component="span"
|
||||||
|
color={theme.palette.common.main}
|
||||||
ml={theme.spacing(2)}
|
ml={theme.spacing(2)}
|
||||||
sx={{ userSelect: "none" }}
|
sx={{ userSelect: "none" }}
|
||||||
onClick={handleNavigate}
|
onClick={handleNavigate}
|
||||||
|
|||||||
@@ -21,8 +21,10 @@ import { useSelector } from "react-redux";
|
|||||||
import { networkService } from "../../../main";
|
import { networkService } from "../../../main";
|
||||||
import { StatusLabel } from "../../../Components/Label";
|
import { StatusLabel } from "../../../Components/Label";
|
||||||
import { logger } from "../../../Utils/Logger";
|
import { logger } from "../../../Utils/Logger";
|
||||||
|
import { useTheme } from "@emotion/react";
|
||||||
|
|
||||||
const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
||||||
|
const theme = useTheme();
|
||||||
const { authToken, user } = useSelector((state) => state.auth);
|
const { authToken, user } = useSelector((state) => state.auth);
|
||||||
const [checks, setChecks] = useState([]);
|
const [checks, setChecks] = useState([]);
|
||||||
const [checksCount, setChecksCount] = useState(0);
|
const [checksCount, setChecksCount] = useState(0);
|
||||||
@@ -100,6 +102,19 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
|||||||
page={paginationController.page + 1} //0-indexed
|
page={paginationController.page + 1} //0-indexed
|
||||||
onChange={handlePageChange}
|
onChange={handlePageChange}
|
||||||
shape="rounded"
|
shape="rounded"
|
||||||
|
sx={{
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
|
border: 1,
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
"& button": {
|
||||||
|
color: theme.palette.text.tertiary,
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
|
},
|
||||||
|
"& li:first-of-type button, & li:last-of-type button": {
|
||||||
|
border: 1,
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
},
|
||||||
|
}}
|
||||||
renderItem={(item) => (
|
renderItem={(item) => (
|
||||||
<PaginationItem
|
<PaginationItem
|
||||||
slots={{
|
slots={{
|
||||||
@@ -111,6 +126,13 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
|||||||
"&:focus": {
|
"&:focus": {
|
||||||
outline: "none",
|
outline: "none",
|
||||||
},
|
},
|
||||||
|
"& .MuiTouchRipple-root": {
|
||||||
|
pointerEvents: "none",
|
||||||
|
display: "none",
|
||||||
|
},
|
||||||
|
"&.Mui-selected, &.Mui-selected:hover": {
|
||||||
|
backgroundColor: theme.palette.background.fill,
|
||||||
|
},
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
@@ -118,24 +140,50 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let sharedStyles = {
|
||||||
|
border: 1,
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
|
p: theme.spacing(30),
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{checks?.length === 0 && selectedMonitor === "0" ? (
|
{checks?.length === 0 && selectedMonitor === "0" ? (
|
||||||
<Box>
|
<Box sx={{ ...sharedStyles }}>
|
||||||
<Typography textAlign="center">No incidents recorded yet.</Typography>
|
<Typography textAlign="center" color={theme.palette.text.secondary}>
|
||||||
|
No incidents recorded yet.
|
||||||
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
) : checks?.length === 0 ? (
|
) : checks?.length === 0 ? (
|
||||||
<Box>
|
<Box sx={{ ...sharedStyles }}>
|
||||||
<Typography textAlign="center">
|
<Typography textAlign="center" color={theme.palette.text.secondary}>
|
||||||
The monitor you have selected has no recorded incidents yet.
|
The monitor you have selected has no recorded incidents yet.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<TableContainer component={Paper}>
|
<TableContainer
|
||||||
|
component={Paper}
|
||||||
|
sx={{
|
||||||
|
border: `solid 1px ${theme.palette.border.light}`,
|
||||||
|
borderRadius: theme.shape.borderRadius,
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Table>
|
<Table>
|
||||||
<TableHead>
|
<TableHead
|
||||||
<TableRow>
|
sx={{
|
||||||
|
backgroundColor: theme.palette.background.accent,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<TableRow
|
||||||
|
sx={{
|
||||||
|
"& > .MuiTableCell-root": {
|
||||||
|
color: theme.palette.text.secondary,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<TableCell>Monitor Name</TableCell>
|
<TableCell>Monitor Name</TableCell>
|
||||||
<TableCell>Status</TableCell>
|
<TableCell>Status</TableCell>
|
||||||
<TableCell>Date & Time</TableCell>
|
<TableCell>Date & Time</TableCell>
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
.incidents h1.MuiTypography-root,
|
|
||||||
.incidents p.MuiTypography-root {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.incidents h1.MuiTypography-root {
|
.incidents h1.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large);
|
font-size: var(--env-var-font-size-large);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -12,19 +8,4 @@
|
|||||||
}
|
}
|
||||||
.incidents button.MuiButtonBase-root {
|
.incidents button.MuiButtonBase-root {
|
||||||
height: 34px;
|
height: 34px;
|
||||||
border-color: var(--border-color);
|
|
||||||
}
|
|
||||||
.incidents .MuiPagination-root {
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
}
|
|
||||||
.incidents > .MuiBox-root {
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
border: solid 1px var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
padding: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* remove later */
|
|
||||||
.incidents .MuiSelect-select {
|
|
||||||
padding: 0 10px;
|
|
||||||
}
|
}
|
||||||
@@ -78,13 +78,17 @@ const Incidents = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="incidents" pt={theme.gap.xl} gap={theme.gap.large}>
|
<Stack className="incidents" pt={theme.spacing(20)} gap={theme.spacing(12)}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<SkeletonLayout />
|
<SkeletonLayout />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Stack direction="row" alignItems="center" gap={theme.gap.medium}>
|
<Stack direction="row" alignItems="center" gap={theme.spacing(6)}>
|
||||||
<Typography display="inline-block" component="h1">
|
<Typography
|
||||||
|
display="inline-block"
|
||||||
|
component="h1"
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
Incidents for
|
Incidents for
|
||||||
</Typography>
|
</Typography>
|
||||||
<Select
|
<Select
|
||||||
@@ -93,15 +97,27 @@ const Incidents = () => {
|
|||||||
value={selectedMonitor}
|
value={selectedMonitor}
|
||||||
onChange={handleSelect}
|
onChange={handleSelect}
|
||||||
items={Object.values(monitors)}
|
items={Object.values(monitors)}
|
||||||
|
sx={{
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<ButtonGroup sx={{ ml: "auto" }}>
|
<ButtonGroup
|
||||||
|
sx={{
|
||||||
|
ml: "auto",
|
||||||
|
"& .MuiButtonBase-root, & .MuiButtonBase-root:hover": {
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
level="secondary"
|
level="secondary"
|
||||||
label="All"
|
label="All"
|
||||||
onClick={() => setFilter("all")}
|
onClick={() => setFilter("all")}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
filter === "all" && theme.palette.otherColors.fillGray,
|
filter === "all"
|
||||||
|
? theme.palette.background.fill
|
||||||
|
: theme.palette.background.main,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
@@ -110,7 +126,9 @@ const Incidents = () => {
|
|||||||
onClick={() => setFilter("down")}
|
onClick={() => setFilter("down")}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
filter === "down" && theme.palette.otherColors.fillGray,
|
filter === "down"
|
||||||
|
? theme.palette.background.fill
|
||||||
|
: theme.palette.background.main,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Button
|
<Button
|
||||||
@@ -119,7 +137,9 @@ const Incidents = () => {
|
|||||||
onClick={() => setFilter("resolve")}
|
onClick={() => setFilter("resolve")}
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor:
|
backgroundColor:
|
||||||
filter === "resolve" && theme.palette.otherColors.fillGray,
|
filter === "resolve"
|
||||||
|
? theme.palette.background.fill
|
||||||
|
: theme.palette.background.main,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
.integrations h1.MuiTypography-root,
|
|
||||||
.integrations p.MuiTypography-root {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.integrations h1.MuiTypography-root {
|
.integrations h1.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large);
|
font-size: var(--env-var-font-size-large);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
@@ -12,9 +8,3 @@
|
|||||||
.integrations button {
|
.integrations button {
|
||||||
height: var(--env-var-height-2);
|
height: var(--env-var-height-2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.integrations .MuiGrid-item > .MuiStack-root {
|
|
||||||
border: solid 1px var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
}
|
|
||||||
@@ -25,13 +25,17 @@ const IntegrationsComponent = ({ icon, header, info, onClick }) => {
|
|||||||
<Stack
|
<Stack
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="space-between"
|
justifyContent="space-between"
|
||||||
gap={theme.gap.large}
|
gap={theme.spacing(12)}
|
||||||
p={theme.gap.ml}
|
p={theme.spacing(8)}
|
||||||
pl={theme.gap.large}
|
pl={theme.spacing(12)}
|
||||||
height="100%"
|
height="100%"
|
||||||
|
border={1}
|
||||||
|
borderColor={theme.palette.border.light}
|
||||||
|
borderRadius={theme.shape.borderRadius}
|
||||||
|
backgroundColor={theme.palette.background.main}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
<Stack gap={theme.gap.xs} flex={1}>
|
<Stack gap={theme.spacing(2)} flex={1}>
|
||||||
<Typography component="h1">{header}</Typography>
|
<Typography component="h1">{header}</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{
|
sx={{
|
||||||
@@ -108,12 +112,21 @@ const Integrations = () => {
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="integrations" pt={theme.gap.xl} gap={theme.gap.xs}>
|
<Stack
|
||||||
|
className="integrations"
|
||||||
|
pt={theme.spacing(20)}
|
||||||
|
gap={theme.spacing(2)}
|
||||||
|
sx={{
|
||||||
|
"& h1, & p": {
|
||||||
|
color: theme.palette.text.secondary,
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Typography component="h1">Integrations</Typography>
|
<Typography component="h1">Integrations</Typography>
|
||||||
<Typography mb={theme.gap.large}>
|
<Typography mb={theme.spacing(12)}>
|
||||||
Connect BlueWave Uptime to your favorite service.
|
Connect BlueWave Uptime to your favorite service.
|
||||||
</Typography>
|
</Typography>
|
||||||
<Grid container spacing={theme.gap.large}>
|
<Grid container spacing={theme.spacing(12)}>
|
||||||
{integrations.map((integration, index) => (
|
{integrations.map((integration, index) => (
|
||||||
<IntegrationsComponent
|
<IntegrationsComponent
|
||||||
key={index}
|
key={index}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import Field from "../../../Components/Inputs/Field";
|
|||||||
import { maintenanceWindowValidation } from "../../../Validation/validation";
|
import { maintenanceWindowValidation } from "../../../Validation/validation";
|
||||||
import { logger } from "../../../Utils/Logger";
|
import { logger } from "../../../Utils/Logger";
|
||||||
import { createToast } from "../../../Utils/toastUtils";
|
import { createToast } from "../../../Utils/toastUtils";
|
||||||
|
import { useTheme } from "@emotion/react";
|
||||||
|
|
||||||
const directory = {
|
const directory = {
|
||||||
title: "Create a maintenance window",
|
title: "Create a maintenance window",
|
||||||
@@ -56,6 +57,8 @@ const durationOptions = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const CreateNewMaintenanceWindow = () => {
|
const CreateNewMaintenanceWindow = () => {
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
const [values, setValues] = useState({
|
const [values, setValues] = useState({
|
||||||
repeat: 1,
|
repeat: 1,
|
||||||
date: dayjs(),
|
date: dayjs(),
|
||||||
@@ -159,7 +162,11 @@ const CreateNewMaintenanceWindow = () => {
|
|||||||
{
|
{
|
||||||
title: "Duration",
|
title: "Duration",
|
||||||
component: (
|
component: (
|
||||||
<Stack className="duration-config" gap={2} direction="row">
|
<Stack
|
||||||
|
className="duration-config"
|
||||||
|
gap={theme.spacing(5)}
|
||||||
|
direction="row"
|
||||||
|
>
|
||||||
<Field
|
<Field
|
||||||
id="duration-value"
|
id="duration-value"
|
||||||
placeholder="60"
|
placeholder="60"
|
||||||
@@ -195,7 +202,7 @@ const CreateNewMaintenanceWindow = () => {
|
|||||||
<Stack
|
<Stack
|
||||||
className="add-monitors-fields"
|
className="add-monitors-fields"
|
||||||
sx={{ width: "60%", maxWidth: "380px" }}
|
sx={{ width: "60%", maxWidth: "380px" }}
|
||||||
gap={2}
|
gap={theme.spacing(5)}
|
||||||
>
|
>
|
||||||
<Field
|
<Field
|
||||||
id="add-monitors"
|
id="add-monitors"
|
||||||
@@ -208,7 +215,7 @@ const CreateNewMaintenanceWindow = () => {
|
|||||||
sx={{
|
sx={{
|
||||||
width: "fit-content",
|
width: "fit-content",
|
||||||
fontSize: "var(--env-var-font-size-small)",
|
fontSize: "var(--env-var-font-size-small)",
|
||||||
borderBottom: "1px dashed var(--env-var-color-3)",
|
borderBottom: `1px dashed ${theme.palette.common.main}`,
|
||||||
paddingBottom: "4px",
|
paddingBottom: "4px",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -221,15 +228,15 @@ const CreateNewMaintenanceWindow = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="create-maintenance-window">
|
<div className="create-maintenance-window">
|
||||||
<Stack gap={3}>
|
<Stack gap={theme.spacing(10)}>
|
||||||
<Button
|
<Button
|
||||||
id="btn-back"
|
id="btn-back"
|
||||||
sx={{
|
sx={{
|
||||||
width: "100px",
|
width: "100px",
|
||||||
height: "30px",
|
height: "30px",
|
||||||
gap: "10px",
|
gap: "10px",
|
||||||
backgroundColor: "var(--env-var-color-32)",
|
backgroundColor: theme.palette.background.fill,
|
||||||
color: "var(--env-var-color-5)",
|
color: theme.palette.text.secondary,
|
||||||
}}
|
}}
|
||||||
label="Back"
|
label="Back"
|
||||||
level="tertiary"
|
level="tertiary"
|
||||||
@@ -239,8 +246,8 @@ const CreateNewMaintenanceWindow = () => {
|
|||||||
<Typography
|
<Typography
|
||||||
sx={{
|
sx={{
|
||||||
fontSize: "var(--env-var-font-size-large)",
|
fontSize: "var(--env-var-font-size-large)",
|
||||||
fontWeight: "600",
|
fontWeight: 600,
|
||||||
color: "var(--env-var-color-5)",
|
color: theme.palette.text.secondary,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{directory.title}
|
{directory.title}
|
||||||
@@ -252,14 +259,14 @@ const CreateNewMaintenanceWindow = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
<Stack
|
<Stack
|
||||||
className="maintenance-options"
|
className="maintenance-options"
|
||||||
gap={5}
|
gap={theme.spacing(20)}
|
||||||
paddingY={4}
|
paddingY={theme.spacing(15)}
|
||||||
paddingX={8}
|
paddingX={theme.spacing(20)}
|
||||||
paddingBottom={10}
|
|
||||||
sx={{
|
sx={{
|
||||||
border: "1px solid var(--env-var-color-16)",
|
border: 1,
|
||||||
borderRadius: "var(--env-var-radius-1)",
|
borderColor: theme.palette.border.light,
|
||||||
backgroundColor: "var(--env-var-color-0)",
|
borderRadius: theme.shape.borderRadius,
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{configOptions.map((item, index) => (
|
{configOptions.map((item, index) => (
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useTheme } from "@emotion/react";
|
|||||||
import Fallback from "../../Components/Fallback";
|
import Fallback from "../../Components/Fallback";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
|
|
||||||
const Maintenance = () => {
|
const Maintenance = ({ isAdmin }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -29,6 +29,7 @@ const Maintenance = () => {
|
|||||||
"Stop sending alerts in maintenance windows",
|
"Stop sending alerts in maintenance windows",
|
||||||
]}
|
]}
|
||||||
link="/maintenance/create"
|
link="/maintenance/create"
|
||||||
|
isAdmin={isAdmin}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Stack, Typography } from "@mui/material";
|
import { Box, Stack, Typography } from "@mui/material";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
/**
|
/**
|
||||||
* Host component.
|
* Host component.
|
||||||
@@ -13,12 +13,39 @@ import PropTypes from "prop-types";
|
|||||||
*/
|
*/
|
||||||
const Host = ({ params }) => {
|
const Host = ({ params }) => {
|
||||||
return (
|
return (
|
||||||
<Stack direction="row" alignItems="baseline" className="host">
|
<Box className="host">
|
||||||
{params.title}
|
<Box
|
||||||
<Typography component="span" sx={{ color: params.percentageColor }}>
|
display="inline-block"
|
||||||
|
position="relative"
|
||||||
|
sx={{
|
||||||
|
fontWeight: 500,
|
||||||
|
"&:before": {
|
||||||
|
position: "absolute",
|
||||||
|
content: `""`,
|
||||||
|
width: "4px",
|
||||||
|
height: "4px",
|
||||||
|
borderRadius: "50%",
|
||||||
|
backgroundColor: "gray",
|
||||||
|
opacity: 0.8,
|
||||||
|
right: "-10px",
|
||||||
|
top: "42%",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{params.title}
|
||||||
|
</Box>
|
||||||
|
<Typography
|
||||||
|
component="span"
|
||||||
|
sx={{
|
||||||
|
color: params.percentageColor,
|
||||||
|
fontWeight: 500,
|
||||||
|
ml: "15px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
{params.percentage}%
|
{params.percentage}%
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
<Box sx={{ opacity: 0.6 }}>{params.url}</Box>
|
||||||
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import SkeletonLayout from "./skeleton";
|
|||||||
import Fallback from "./fallback";
|
import Fallback from "./fallback";
|
||||||
import StatusBox from "./StatusBox";
|
import StatusBox from "./StatusBox";
|
||||||
import { buildData } from "./monitorData";
|
import { buildData } from "./monitorData";
|
||||||
|
import Breadcrumbs from "../../../Components/Breadcrumbs";
|
||||||
|
|
||||||
const Monitors = ({ isAdmin }) => {
|
const Monitors = ({ isAdmin }) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
@@ -33,35 +34,73 @@ const Monitors = ({ isAdmin }) => {
|
|||||||
|
|
||||||
let loading = monitorState.isLoading && monitorState.monitors.length === 0;
|
let loading = monitorState.isLoading && monitorState.monitors.length === 0;
|
||||||
|
|
||||||
|
const now = new Date();
|
||||||
|
const hour = now.getHours();
|
||||||
|
|
||||||
|
let greeting = "";
|
||||||
|
let emoji = "";
|
||||||
|
if (hour < 12) {
|
||||||
|
greeting = "morning";
|
||||||
|
emoji = "🌅";
|
||||||
|
} else if (hour < 18) {
|
||||||
|
greeting = "afternoon";
|
||||||
|
emoji = "🌞";
|
||||||
|
} else {
|
||||||
|
greeting = "evening";
|
||||||
|
emoji = "🌙";
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="monitors" gap={theme.gap.large}>
|
<Stack className="monitors" gap={theme.gap.large}>
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<SkeletonLayout />
|
<SkeletonLayout />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Stack
|
<Box>
|
||||||
direction="row"
|
<Breadcrumbs list={[{ name: `monitors`, path: "/monitors" }]} />
|
||||||
justifyContent="space-between"
|
<Stack
|
||||||
alignItems="center"
|
direction="row"
|
||||||
>
|
justifyContent="space-between"
|
||||||
<Typography
|
alignItems="center"
|
||||||
component="h1"
|
mt={theme.spacing(5)}
|
||||||
sx={{ lineHeight: 1, alignSelf: "flex-end" }}
|
|
||||||
>
|
>
|
||||||
Hello, {authState.user.firstName}
|
<Box>
|
||||||
</Typography>
|
<Typography component="h1" lineHeight={1}>
|
||||||
{monitorState.monitors?.length !== 0 && (
|
<Typography
|
||||||
<Button
|
component="span"
|
||||||
level="primary"
|
fontSize="inherit"
|
||||||
label="Create monitor"
|
color={theme.palette.otherColors.bluishGray}
|
||||||
onClick={() => {
|
>
|
||||||
navigate("/monitors/create");
|
Good {greeting},{" "}
|
||||||
}}
|
</Typography>
|
||||||
sx={{ fontWeight: 500 }}
|
<Typography
|
||||||
/>
|
component="span"
|
||||||
)}
|
fontSize="inherit"
|
||||||
</Stack>
|
fontWeight="inherit"
|
||||||
|
>
|
||||||
|
{authState.user.firstName} {emoji}
|
||||||
|
</Typography>
|
||||||
|
</Typography>
|
||||||
|
<Typography
|
||||||
|
sx={{ opacity: 0.8 }}
|
||||||
|
lineHeight={1}
|
||||||
|
fontWeight={300}
|
||||||
|
>
|
||||||
|
Here’s an overview of your uptime monitors.
|
||||||
|
</Typography>
|
||||||
|
</Box>
|
||||||
|
{monitorState.monitors?.length !== 0 && (
|
||||||
|
<Button
|
||||||
|
level="primary"
|
||||||
|
label="Create monitor"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/monitors/create");
|
||||||
|
}}
|
||||||
|
sx={{ fontWeight: 500 }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Stack>
|
||||||
|
</Box>
|
||||||
{monitorState.monitors?.length === 0 && (
|
{monitorState.monitors?.length === 0 && (
|
||||||
<Fallback isAdmin={isAdmin} />
|
<Fallback isAdmin={isAdmin} />
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -29,12 +29,11 @@ const data = {
|
|||||||
export const buildData = (monitors, isAdmin, navigate) => {
|
export const buildData = (monitors, isAdmin, navigate) => {
|
||||||
data.rows = monitors.map((monitor, idx) => {
|
data.rows = monitors.map((monitor, idx) => {
|
||||||
const params = {
|
const params = {
|
||||||
|
url: monitor.url,
|
||||||
title: monitor.name,
|
title: monitor.name,
|
||||||
percentage: 100,
|
percentage: 100,
|
||||||
percentageColor:
|
percentageColor:
|
||||||
monitor.status === true
|
monitor.status === true ? "var(--success-color)" : "var(--error-color)",
|
||||||
? "var(--env-var-color-17)"
|
|
||||||
: "var(--env-var-color-19)",
|
|
||||||
status: monitor.status === true ? "up" : "down",
|
status: monitor.status === true ? "up" : "down",
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -43,7 +42,6 @@ export const buildData = (monitors, isAdmin, navigate) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
id: monitor._id,
|
id: monitor._id,
|
||||||
// disabled for now
|
|
||||||
handleClick: () => {
|
handleClick: () => {
|
||||||
navigate(`/monitors/${monitor._id}`);
|
navigate(`/monitors/${monitor._id}`);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
.not-found-page {
|
|
||||||
height: 100vh;
|
|
||||||
}
|
|
||||||
.not-found-page button,
|
|
||||||
.not-found-page p {
|
|
||||||
font-size: var(--env-var-font-size-medium);
|
|
||||||
}
|
|
||||||
.not-found-page h1 {
|
|
||||||
font-size: var(--env-var-font-size-large);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
.not-found-page h1,
|
|
||||||
.not-found-page p {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
import "./index.css";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
|
import NotFoundSvg from "../../../src/assets/Images/sushi_404.svg";
|
||||||
import { Stack, Typography } from "@mui/material";
|
import { Stack, Typography } from "@mui/material";
|
||||||
import { useNavigate } from "react-router";
|
import { useNavigate } from "react-router";
|
||||||
import NotFoundSvg from "../../../src/assets/Images/sushi_404.svg";
|
import { useTheme } from "@emotion/react";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Support for defaultProps will be removed from function components in a future major release
|
* Support for defaultProps will be removed from function components in a future major release
|
||||||
@@ -33,16 +33,24 @@ const DefaultValue = {
|
|||||||
*/
|
*/
|
||||||
const NotFound = ({ title = DefaultValue.title, desc = DefaultValue.desc }) => {
|
const NotFound = ({ title = DefaultValue.title, desc = DefaultValue.desc }) => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="not-found-page" justifyContent="center">
|
<Stack height="100vh" justifyContent="center">
|
||||||
<Stack gap="20px" alignItems="center">
|
<Stack
|
||||||
|
gap={theme.spacing(2)}
|
||||||
|
alignItems="center"
|
||||||
|
color={theme.palette.text.secondary}
|
||||||
|
>
|
||||||
<img src={NotFoundSvg} alt="404" style={{ maxHeight: "25rem" }} />
|
<img src={NotFoundSvg} alt="404" style={{ maxHeight: "25rem" }} />
|
||||||
<Typography component="h1">{title}</Typography>
|
<Typography component="h1" fontSize={16} fontWeight={600}>
|
||||||
<Typography>{desc}</Typography>
|
{title}
|
||||||
|
</Typography>
|
||||||
|
<Typography fontSize={13}>{desc}</Typography>
|
||||||
<Button
|
<Button
|
||||||
label="Go to the main dashboard"
|
label="Go to the main dashboard"
|
||||||
level="primary"
|
level="primary"
|
||||||
sx={{ mt: "24px" }}
|
sx={{ mt: theme.spacing(10) }}
|
||||||
onClick={() => navigate("/")}
|
onClick={() => navigate("/")}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -33,6 +33,3 @@
|
|||||||
height: 34px;
|
height: 34px;
|
||||||
align-self: flex-end;
|
align-self: flex-end;
|
||||||
}
|
}
|
||||||
.page-speed [class*="fallback__"] h1 {
|
|
||||||
margin-left: var(--env-var-spacing-3);
|
|
||||||
}
|
|
||||||
@@ -189,7 +189,7 @@ const PageSpeed = ({ isAdmin }) => {
|
|||||||
</Stack>
|
</Stack>
|
||||||
) : (
|
) : (
|
||||||
<Fallback
|
<Fallback
|
||||||
title="page speed"
|
title="pagespeed monitor"
|
||||||
checks={[
|
checks={[
|
||||||
"Report on the user experience of a page",
|
"Report on the user experience of a page",
|
||||||
"Help analyze webpage speed",
|
"Help analyze webpage speed",
|
||||||
|
|||||||
@@ -5,11 +5,6 @@
|
|||||||
.settings p.MuiTypography-root {
|
.settings p.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-medium);
|
font-size: var(--env-var-font-size-medium);
|
||||||
}
|
}
|
||||||
.settings h1.MuiTypography-root,
|
|
||||||
.settings h2.MuiTypography-root,
|
|
||||||
.settings p.MuiTypography-root {
|
|
||||||
color: var(--secondary-color);
|
|
||||||
}
|
|
||||||
.settings h1.MuiTypography-root {
|
.settings h1.MuiTypography-root {
|
||||||
font-size: var(--env-var-font-size-large);
|
font-size: var(--env-var-font-size-large);
|
||||||
}
|
}
|
||||||
@@ -24,20 +19,3 @@
|
|||||||
opacity: 0.6;
|
opacity: 0.6;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
.settings .config-box {
|
|
||||||
padding: var(--env-var-spacing-4) 50px;
|
|
||||||
padding-bottom: 60px;
|
|
||||||
border: 1px solid var(--border-color);
|
|
||||||
border-radius: var(--env-var-radius-1);
|
|
||||||
background-color: var(--primary-bg);
|
|
||||||
}
|
|
||||||
.settings .config-box .MuiBox-root,
|
|
||||||
.settings .config-box .MuiStack-root {
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.settings-form {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: var(--env-var-spacing-4);
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { Box, Stack, Typography } from "@mui/material";
|
import { Box, Stack, styled, Typography } from "@mui/material";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
import Field from "../../Components/Inputs/Field";
|
import Field from "../../Components/Inputs/Field";
|
||||||
import Link from "../../Components/Link";
|
import Link from "../../Components/Link";
|
||||||
@@ -10,6 +10,33 @@ import "./index.css";
|
|||||||
const Settings = () => {
|
const Settings = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
|
|
||||||
|
const ConfigBox = styled("div")({
|
||||||
|
display: "flex",
|
||||||
|
flexDirection: "row",
|
||||||
|
justifyContent: "space-between",
|
||||||
|
gap: theme.spacing(20),
|
||||||
|
paddingTop: theme.spacing(12),
|
||||||
|
paddingInline: theme.spacing(15),
|
||||||
|
paddingBottom: theme.spacing(25),
|
||||||
|
backgroundColor: theme.palette.background.main,
|
||||||
|
border: 1,
|
||||||
|
borderStyle: "solid",
|
||||||
|
borderColor: theme.palette.border.light,
|
||||||
|
borderRadius: theme.spacing(2),
|
||||||
|
"& > div:first-of-type": {
|
||||||
|
flex: 0.7,
|
||||||
|
},
|
||||||
|
"& > div:last-of-type": {
|
||||||
|
flex: 1,
|
||||||
|
},
|
||||||
|
"& h1, & h2": {
|
||||||
|
color: theme.palette.text.secondary,
|
||||||
|
},
|
||||||
|
"& p": {
|
||||||
|
color: theme.palette.text.tertiary,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
className="settings"
|
className="settings"
|
||||||
@@ -17,16 +44,16 @@ const Settings = () => {
|
|||||||
paddingBottom: 0,
|
paddingBottom: 0,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<form className="settings-form" noValidate spellCheck="false">
|
<Stack
|
||||||
<Stack
|
component="form"
|
||||||
className="config-box"
|
gap={theme.spacing(12)}
|
||||||
direction="row"
|
noValidate
|
||||||
justifyContent="space-between"
|
spellCheck="false"
|
||||||
gap={theme.gap.xxl}
|
>
|
||||||
>
|
<ConfigBox>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h1">General Settings</Typography>
|
<Typography component="h1">General Settings</Typography>
|
||||||
<Typography sx={{ mt: theme.gap.small, mb: theme.gap.xs }}>
|
<Typography sx={{ mt: theme.spacing(2), mb: theme.spacing(2) }}>
|
||||||
<Typography component="span">Display timezone</Typography>- The
|
<Typography component="span">Display timezone</Typography>- The
|
||||||
timezone of the dashboard you publicly display.
|
timezone of the dashboard you publicly display.
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -51,16 +78,11 @@ const Settings = () => {
|
|||||||
items={[{ _id: "est", name: "America / Toronto" }]}
|
items={[{ _id: "est", name: "America / Toronto" }]}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
<Stack
|
<ConfigBox>
|
||||||
className="config-box"
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
gap={theme.gap.xxl}
|
|
||||||
>
|
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h1">History and monitoring</Typography>
|
<Typography component="h1">History and monitoring</Typography>
|
||||||
<Typography sx={{ mt: theme.gap.small }}>
|
<Typography sx={{ mt: theme.spacing(2) }}>
|
||||||
Define here for how long you want to keep the data. You can also
|
Define here for how long you want to keep the data. You can also
|
||||||
remove all past data.
|
remove all past data.
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -81,24 +103,19 @@ const Settings = () => {
|
|||||||
<Button
|
<Button
|
||||||
level="error"
|
level="error"
|
||||||
label="Clear all stats"
|
label="Clear all stats"
|
||||||
sx={{ mt: theme.gap.small }}
|
sx={{ mt: theme.spacing(4) }}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
<Stack
|
<ConfigBox>
|
||||||
className="config-box"
|
|
||||||
direction="row"
|
|
||||||
justifyContent="space-between"
|
|
||||||
gap={theme.gap.xxl}
|
|
||||||
>
|
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h1">About</Typography>
|
<Typography component="h1">About</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Typography component="h2">BlueWave Uptime v1.0.0</Typography>
|
<Typography component="h2">BlueWave Uptime v1.0.0</Typography>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{ mt: theme.gap.xs, mb: theme.gap.medium, opacity: 0.6 }}
|
sx={{ mt: theme.spacing(2), mb: theme.spacing(6), opacity: 0.6 }}
|
||||||
>
|
>
|
||||||
Developed by Bluewave Labs.
|
Developed by Bluewave Labs.
|
||||||
</Typography>
|
</Typography>
|
||||||
@@ -108,11 +125,15 @@ const Settings = () => {
|
|||||||
label="https://github.com/bluewave-labs"
|
label="https://github.com/bluewave-labs"
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</ConfigBox>
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
<Stack direction="row" justifyContent="flex-end">
|
||||||
<Button level="primary" label="Save" sx={{ px: theme.gap.large }} />
|
<Button
|
||||||
|
level="primary"
|
||||||
|
label="Save"
|
||||||
|
sx={{ px: theme.spacing(12), mt: theme.spacing(20) }}
|
||||||
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</form>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user