Updated layout (#450)

* Updated layout

* Fixed error

* Changed integration background to white
This commit is contained in:
Daniel C authored and GitHub committed 2024-07-26 09:39:18 -07:00
1 parent 0339922db8
commit 40a268ab18
54 files changed
+441 -773

No files matched your search

+2 -9
View File
@@ -29,14 +29,7 @@ const Account = ({ open = "profile" }) => {
if (!user.role.includes("admin")) tabList = ["Profile", "Password"];
return (
<Box
//TODO - breakpoints for responsive design
minWidth={theme.spacing(55)}
maxWidth="1200px"
py={theme.content.pY}
px={theme.content.pX}
className="account"
>
<Box className="account">
<TabContext value={tab}>
<Box
sx={{
@@ -74,7 +67,7 @@ const Account = ({ open = "profile" }) => {
</Box>
<ProfilePanel />
<PasswordPanel />
{ user.role.includes("admin") && <TeamPanel />}
{user.role.includes("admin") && <TeamPanel />}
</TabContext>
</Box>
);
+1 -7
View File
@@ -104,13 +104,7 @@ const Incidents = () => {
data.rows = incidents;
return (
<Stack
className="incidents"
gap={theme.gap.large}
style={{
padding: `${theme.content.pY} ${theme.content.pX}`,
}}
>
<Stack className="incidents" gap={theme.gap.large}>
<Stack direction="row" alignItems="center" gap={theme.gap.medium}>
<Typography component="h1">Incident history for: </Typography>
<Select
+14
View File
@@ -0,0 +1,14 @@
.integrations h1.MuiTypography-root,
.integrations p.MuiTypography-root {
color: var(--env-var-color-5);
}
.integrations h1.MuiTypography-root {
font-size: var(--env-var-font-size-large);
font-weight: 600;
}
.integrations p.MuiTypography-root {
font-size: var(--env-var-font-size-medium);
}
.integrations button {
height: var(--env-var-height-2);
}
+91 -43
View File
@@ -1,60 +1,108 @@
import { Box, Typography, useTheme } from '@mui/material';
import IntegrationsComponent from '../../Components/Integrations';
import PropTypes from "prop-types";
import { Stack, Box, Typography, Grid } from "@mui/material";
import Button from "../../Components/Button";
import { useTheme } from "@emotion/react";
import "./index.css";
/**
* Integrations component
* @param {Object} props - Props for the IntegrationsComponent.
* @param {string} props.url - The URL for the integration image.
* @param {string} props.header - The header for the integration.
* @param {string} props.info - Information about the integration.
* @param {Function} props.onClick - The onClick handler for the integration button.
* @returns {JSX.Element} The JSX representation of the IntegrationsComponent.
*/
const IntegrationsComponent = ({ url, header, info, onClick }) => {
const theme = useTheme();
return (
<Grid item lg={6} flexGrow={1}>
<Stack
direction="row"
justifyContent="space-between"
gap={theme.gap.large}
p={theme.gap.large}
border={1}
borderColor={theme.palette.divider}
borderRadius={`${theme.shape.borderRadius}px`}
sx={{ backgroundColor: theme.palette.otherColors.white }}
>
<Box
component="img"
src={url}
alt="Integration"
width={80}
height={80}
/>
<Stack gap={theme.gap.xs} flex={1}>
<Typography component="h1">{header}</Typography>
<Typography
sx={{
maxWidth: "300px",
wordWrap: "break-word",
}}
>
{info}
</Typography>
</Stack>
<Button
label="Add"
level="primary"
onClick={onClick}
sx={{ alignSelf: "center" }}
/>
</Stack>
</Grid>
);
};
// PropTypes for IntegrationsComponent
IntegrationsComponent.propTypes = {
url: PropTypes.string.isRequired,
header: PropTypes.string.isRequired,
info: PropTypes.string.isRequired,
onClick: PropTypes.func.isRequired,
};
/**
* Integrations Page Component
* @returns {JSX.Element} The JSX representation of the Integrations page.
*/
const Integrations = () => {
const theme = useTheme();
const integrations = [
{
url: 'https://via.placeholder.com/100',
header: 'Integration 1',
info: 'Info about Integration 1',
onClick: () => {}
{
url: "https://via.placeholder.com/80",
header: "Slack",
info: "Connect with Slack and see incidents in a channel",
onClick: () => {},
},
{
url: "https://via.placeholder.com/80",
header: "Discord",
info: "Connect with Discord and view incidents directly in a channel",
onClick: () => {},
},
{
url: "https://via.placeholder.com/80",
header: "Zapier",
info: "Send all incidents to Zapier, and then see them everywhere",
onClick: () => {},
},
{
url: 'https://via.placeholder.com/100',
header: 'Integration 2',
info: 'Info about Integration 2',
onClick: () => {}
},
{
url: 'https://via.placeholder.com/100',
header: 'Integration 2',
info: 'Info about Integration 2',
onClick: () => {}
}
// Add more integrations as needed
];
return (
<Box
display="flex"
flexDirection="column"
alignItems="flex-start"
justifyContent="flex-start"
height="100vh"
p={theme.spacing(4)}
mt={theme.spacing(8)}
>
<Typography variant="h4" component="h1" gutterBottom style={{ fontSize: '16px' }}>
Integrations
</Typography>
<Typography variant="h6" component="h2" gutterBottom style={{ fontSize: '13px' }}>
Connect Uptime Genie to your favorite service
</Typography>
<Box
display="flex"
flexWrap="wrap"
gap={theme.spacing(4)}
>
<Stack className="integrations" gap={theme.gap.xs}>
<Typography component="h1">Integrations</Typography>
<Typography>Connect Uptime Genie to your favorite service</Typography>
<Grid container spacing={theme.gap.large} mt={theme.gap.xs}>
{integrations.map((integration, index) => (
<IntegrationsComponent
<IntegrationsComponent
key={index}
url={integration.url}
header={integration.header}
@@ -62,8 +110,8 @@ const Integrations = () => {
onClick={integration.onClick}
/>
))}
</Box>
</Box>
</Grid>
</Stack>
);
};
+1 -6
View File
@@ -6,12 +6,7 @@ const Maintenance = () => {
const theme = useTheme();
return (
<div
className="maintenance"
style={{
padding: `${theme.content.pY} ${theme.content.pX}`,
}}
>
<div className="maintenance">
<Fallback
title="maintenance window"
checks={[
@@ -128,14 +128,7 @@ const Configure = () => {
];
return (
<div
className="configure-monitor"
style={{
maxWidth: "1200px",
padding: `${theme.content.pY} ${theme.content.pX}`,
backgroundColor: "var(--env-var-color-30)",
}}
>
<Box className="configure-monitor">
<Button
level="tertiary"
label="Back"
@@ -304,7 +297,7 @@ const Configure = () => {
<Button level="primary" label="Save" sx={{ px: theme.gap.ml }} />
</Stack>
</form>
</div>
</Box>
);
};
@@ -135,14 +135,7 @@ const CreateMonitor = () => {
];
return (
<div
className="create-monitor"
style={{
maxWidth: "1200px",
padding: `${theme.content.pY} ${theme.content.pX}`,
backgroundColor: "var(--env-var-color-30)",
}}
>
<Box className="create-monitor">
<Button
level="tertiary"
label="Back"
@@ -402,7 +395,7 @@ const CreateMonitor = () => {
/>
</Stack>
</form>
</div>
</Box>
);
};
+2 -8
View File
@@ -199,13 +199,7 @@ const DetailsPage = () => {
};
return (
<div
className="monitor-details"
style={{
padding: `${theme.content.pY} ${theme.content.pX}`,
backgroundColor: "var(--env-var-color-30)",
}}
>
<Box className="monitor-details">
<Button
level="tertiary"
label="Back to Monitors"
@@ -311,7 +305,7 @@ const DetailsPage = () => {
<BasicTable data={data} paginated={true} reversed={true} />
</Box>
</Stack>
</div>
</Box>
);
};
+17 -191
View File
@@ -1,207 +1,33 @@
.monitors,
.new-monitor {
width: 70vw;
}
.monitors {
font-family: var(--env-var-font-familt-1);
background-color: var(--env-var-color-30);
}
.monitors-bar {
display: flex;
justify-content: space-between;
align-items: center;
}
.monitors-bar-title {
.monitors h1.MuiTypography-root,
.monitors h2.MuiTypography-root {
color: var(--env-var-color-1);
font-size: 24px;
font-weight: 700;
}
.monitors-stats {
margin-top: var(--env-var-spacing-2);
display: flex;
gap: 24px;
height: 100px;
}
.monitors-gaps-medium {
height: var(--env-var-spacing-2);
}
.monitors-gaps-small-plus {
height: var(--env-var-spacing-1-plus);
}
.monitors-gaps-small {
height: 6px;
}
.new-monitor-header {
color: var(--env-var-color-1);
font-size: var(--env-var-font-size-large-plus);
font-weight: 600;
}
.service-check-list-title {
color: var(--env-var-color-5);
.monitors h1.MuiTypography-root {
font-size: var(--env-var-font-size-large-plus);
}
.monitors h2.MuiTypography-root {
font-size: var(--env-var-font-size-large);
}
.monitors .MuiStack-root > button {
font-size: var(--env-var-font-size-medium);
}
.service-check-list-desc {
color: var(--env-var-color-25);
font-size: var(--env-var-font-size-small);
}
.host-status-box-text {
font-size: var(--env-var-font-size-medium);
}
.monitors-dropdown-holder {
padding-left: 30px;
}
#ports-list {
width: 172.92px;
height: 12px;
font-size: var(--env-var-font-size-small);
align-items: center;
}
.incident-notif-config-title,
.adv-setting-title {
color: var(--env-var-color-5);
font-size: var(--env-var-font-size-medium);
}
.adv-setting-title {
font-weight: 500;
}
.config-box-inputs,
.service-check-list,
.incident-notif-config,
.advanced-setting-config,
.proxy-setting-config {
min-width: 350px;
padding-right: 40px;
}
.monitors-create-button-holder {
display: flex;
justify-content: end;
}
#create-new-monitor-btn {
padding-top: 6px;
}
#ports-dropdown,
#freq-dropdown {
width: 226.8px;
height: 20px;
}
/* TODO */
.current-monitors {
margin-top: var(--env-var-spacing-2);
border: 1px solid #eaecf0;
padding: 40px;
border-radius: 4px;
}
.current-monitors-title-holder {
display: flex;
align-items: center;
}
.current-monitors-bar {
display: flex;
justify-content: space-between;
}
.current-monitors-title {
font-size: 1rem;
font-weight: bold;
margin-right: var(--env-var-spacing-1);
color: var(--env-var-color-1);
height: var(--env-var-height-2);
min-width: fit-content;
}
.current-monitors-counter {
display: inline-flex;
display: flex;
justify-content: center;
align-items: center;
padding: 2px;
min-width: 22px;
min-height: 22px;
padding: 5px;
min-width: 25px;
min-height: 25px;
background-color: var(--env-var-color-15);
border: 1px solid var(--env-var-color-6);
border-radius: 50%;
font-size: var(--env-var-font-size-medium);
font-weight: 500;
color: var(--env-var-color-5);
}
.monitors-v-gaping {
height: var(--env-var-spacing-3);
}
.current-monitors-table {
width: 100%;
text-align: left;
}
.current-monitors-table {
width: 100%;
text-align: left;
border-collapse: collapse;
border: 1px solid var(--env-var-color-16);
border-radius: var(--env-var-radius-1);
}
.current-monitors-table th,
.current-monitors-table td {
border: 1px solid var(--env-var-color-16);
border-left: none;
border-right: none;
padding: 8px;
}
.theader-row {
background-color: var(--env-var-color-13);
color: var(--env-var-color-2);
font-weight: 500;
}
.theader-row td {
padding: var(--env-var-spacing-1) var(--env-var-spacing-2);
font-size: var(--env-var-font-size-medium);
}
.host-list-item-precentage {
font-size: var(--env-var-font-size-medium);
}
.tbody-row td {
padding: var(--env-var-spacing-2) var(--env-var-img-width-2);
}
.host-status-box {
display: flex;
width: fit-content;
border: 1px solid var(--env-var-color-4);
border-radius: var(--env-var-radius-2);
align-items: center;
padding: calc(var(--env-var-spacing-1) / 2);
}
.host-actions {
margin: auto;
cursor: pointer;
}
.tbody-row-cell.actions-cell {
padding-left: 30px;
margin-left: 10px;
line-height: 0.8;
}
+30 -31
View File
@@ -11,6 +11,7 @@ import OpenInNewPage from "../../assets/icons/open-in-new-page.svg?react";
import BasicTable from "../../Components/BasicTable";
import { StatusLabel } from "../../Components/Label";
import ResponseTimeChart from "../../Components/Charts/ResponseTimeChart";
import { Box, Stack, Typography } from "@mui/material";
/**
* Host component.
@@ -124,49 +125,47 @@ const Monitors = () => {
});
return (
<div
className="monitors"
style={{
padding: `${theme.content.pY} ${theme.content.pX}`,
backgroundColor: "var(--env-var-color-30)",
}}
>
<div className="monitors-bar">
<div className="monitors-bar-title">
<Stack className="monitors" gap={theme.gap.large}>
<Stack direction="row" justifyContent="space-between" alignItems="center">
<Typography component="h1">
Hello, {authState.user.firstName}
</div>
</Typography>
<Button
level="primary"
label="Create new monitor"
onClick={() => {
navigate("/monitors/create");
}}
sx={{ padding: "6px 25px", fontSize: "13px" }}
/>
</div>
<div className="monitors-stats">
</Stack>
<Stack
gap={theme.gap.large}
direction="row"
justifyContent="space-between"
>
<ServerStatus title="Up" value={up} state="up" />
<ServerStatus title="Down" value={down} state="down" />
<ServerStatus title="Paused" value={0} state="pause" />
</div>
<div className="current-monitors">
<div className="current-monitors-bar">
<div className="current-monitors-title-holder">
<div className="current-monitors-title">Current monitors</div>
<div className="current-monitors-counter">
{monitorState.monitors.length}
</div>
</div>
<div className="current-monitors-search-bar">
{/* TODO - add search bar */}
</div>
</div>
<div className="monitors-v-gaping" />
</Stack>
<Stack
gap={theme.gap.large}
p={theme.gap.xl}
sx={{
border: `solid 1px ${theme.palette.otherColors.graishWhite}`,
borderRadius: `${theme.shape.borderRadius}px`,
backgroundColor: theme.palette.otherColors.white,
}}
>
<Stack direction="row" alignItems="center">
<Typography component="h2">Current monitors</Typography>
<Box className="current-monitors-counter">
{monitorState.monitors.length}
</Box>
{/* TODO - add search bar */}
</Stack>
<BasicTable data={data} paginated={true} />
</div>
</div>
</Stack>
</Stack>
);
};
+4
View File
@@ -3,6 +3,7 @@ import "./index.css";
import React from "react";
import PropTypes from "prop-types";
import { Stack, Typography } from "@mui/material";
import { useNavigate } from "react-router";
/**
* Support for defaultProps will be removed from function components in a future major release
@@ -30,6 +31,8 @@ const DefaultValue = {
* @returns {JSX.Element} The rendered error page component.
*/
const NotFound = ({ title = DefaultValue.title, desc = DefaultValue.desc }) => {
const navigate = useNavigate();
return (
<Stack className="not-found-page" justifyContent="center">
<Stack gap="20px" alignItems="center">
@@ -39,6 +42,7 @@ const NotFound = ({ title = DefaultValue.title, desc = DefaultValue.desc }) => {
label="Go to the main dashboard"
level="primary"
sx={{ mt: "24px" }}
onClick={() => navigate("/")}
/>
</Stack>
</Stack>
-3
View File
@@ -14,10 +14,7 @@ const Settings = () => {
<Box
className="settings"
style={{
maxWidth: "1200px",
padding: `${theme.content.pY} ${theme.content.pX}`,
paddingBottom: 0,
backgroundColor: "var(--env-var-color-30)",
}}
>
<form className="settings-form" noValidate spellCheck="false">
+1 -6
View File
@@ -5,12 +5,7 @@ const Status = () => {
const theme = useTheme();
return (
<div
className="status"
style={{
padding: `${theme.content.pY} ${theme.content.pX}`,
}}
>
<div className="status">
<Fallback
title="status page"
checks={[