Doomsday cleanup
This commit is contained in:
1 parent
6dc34be13e
commit
9f68c0b60c
48 files changed
+196
-1138
No files matched your search
@@ -0,0 +1,20 @@
|
||||
.dashboard-menu-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.icon-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.text-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dashboard-menu-text {
|
||||
margin-left: 8px;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
import "./index.css";
|
||||
import DashboardMenuButton from "../DashboardMenuButton";
|
||||
|
||||
import Monitors from "../../../assets/Images/Icon-monitor-gray.png";
|
||||
import Incidents from "../../../assets/Images/Icon-warning-gray.png";
|
||||
import SensorsIcon from "../../../assets/Images/Icon-signal-gray.png";
|
||||
import AllInclusiveIcon from "../../../assets/Images/Icon-link-gray.png";
|
||||
import MaintenanceIcon from "../../../assets/Images/Icon-maintenance-gray.png";
|
||||
import SettingsIcon from "../../../assets/Images/Icon-setting-gray.png";
|
||||
import React, { useState, useEffect } from "react";
|
||||
import { useNavigate, useLocation } from "react-router-dom";
|
||||
import pathMap from "../../../Utils/PathMap";
|
||||
|
||||
/**
|
||||
* @component
|
||||
* DashboardMenu component displays a menu with icons and corresponding text.
|
||||
* Each menu item consists of an icon and a text label.
|
||||
*
|
||||
* @returns {JSX.Element} The JSX element representing the DashboardMenu component.
|
||||
*/
|
||||
|
||||
function DashboardMenu() {
|
||||
const [activeButton, setActiveButton] = useState(null);
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
setActiveButton(location.pathname);
|
||||
}, [location]);
|
||||
|
||||
const handleClick = (title, path) => {
|
||||
setActiveButton(title);
|
||||
navigate(path);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="dashboard-menu-container">
|
||||
{DashboardMenuButton(
|
||||
Monitors,
|
||||
"Monitors",
|
||||
"/monitors",
|
||||
activeButton === "/monitors",
|
||||
() => handleClick(pathMap["/monitors"], "/monitors")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
Incidents,
|
||||
"Incidents",
|
||||
"/incidents",
|
||||
activeButton === "/incidents",
|
||||
() => handleClick(pathMap["/incidents"], "/incidents")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
SensorsIcon,
|
||||
"Status Pages",
|
||||
"/status",
|
||||
activeButton === "/status",
|
||||
() => handleClick(pathMap["/status"], "/status")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
AllInclusiveIcon,
|
||||
"Integrations",
|
||||
"/integrations",
|
||||
activeButton === "/integrations",
|
||||
() => handleClick(pathMap["/integrations"], "/integrations")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
MaintenanceIcon,
|
||||
"Maintenance",
|
||||
"/maintenance",
|
||||
activeButton === "/maintenance",
|
||||
() => handleClick(pathMap["/maintenance"], "/maintenance")
|
||||
)}
|
||||
{DashboardMenuButton(
|
||||
SettingsIcon,
|
||||
"Settings",
|
||||
"/settings",
|
||||
activeButton === "/settings",
|
||||
() => handleClick(pathMap["/settings"], "/settings")
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default DashboardMenu;
|
||||
@@ -0,0 +1,23 @@
|
||||
.icon-container {
|
||||
padding: 8px 15px;
|
||||
}
|
||||
|
||||
.icon-container:hover {
|
||||
background-color: var(--env-var-color-13);
|
||||
border-radius: var(--env-var-radius-1);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.icon-container.active {
|
||||
background-color: var(--env-var-color-13);
|
||||
border-radius: var(--env-var-radius-1);
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: var(--env-var-img-width-1);
|
||||
}
|
||||
|
||||
.dashboard-menu-text {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
color: var(--env-var-color-12);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
import "./index.css";
|
||||
import React, { useState } from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
|
||||
/**
|
||||
* Renders a menu button with an icon and title.
|
||||
*
|
||||
* @component
|
||||
* @param {React.ElementType} icon - The icon component to be rendered.
|
||||
* @param {string} title - The title of the menu button.
|
||||
* @returns {React.ReactElement} The rendered menu button component.
|
||||
*/
|
||||
|
||||
const DashboardMenuButton = (icon, title, to, isActive, onClick) => {
|
||||
const handleClick = () => {
|
||||
onClick();
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`icon-container ${isActive ? "active" : ""}`}
|
||||
onClick={handleClick}
|
||||
>
|
||||
<img className="icon" src={icon} alt="Monitors" />
|
||||
<div className="text-container">
|
||||
<span className="dashboard-menu-text">{title}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default DashboardMenuButton;
|
||||
Whitespace-only changes.
@@ -0,0 +1,19 @@
|
||||
import { BarChart } from "@mui/x-charts/BarChart";
|
||||
|
||||
const ChartsOverviewDemo = () => {
|
||||
return (
|
||||
<BarChart
|
||||
series={[
|
||||
{ data: [35, 44, 24, 34] },
|
||||
{ data: [51, 6, 49, 30] },
|
||||
{ data: [15, 25, 30, 50] },
|
||||
{ data: [60, 50, 15, 25] },
|
||||
]}
|
||||
height={290}
|
||||
xAxis={[{ data: ["Q1", "Q2", "Q3", "Q4"], scaleType: "band" }]}
|
||||
margin={{ top: 10, bottom: 30, left: 40, right: 10 }}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default ChartsOverviewDemo;
|
||||
@@ -0,0 +1,9 @@
|
||||
#dashboard-setting-menu-item {
|
||||
width: 135px;
|
||||
padding: 6px;
|
||||
margin: 5px 12px;
|
||||
}
|
||||
|
||||
#menu-appbar {
|
||||
padding: var(--env-var-spacing-1);
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
import "./index.css";
|
||||
import { useState } from "react";
|
||||
import Box from "@mui/material/Box";
|
||||
import IconButton from "@mui/material/IconButton";
|
||||
import Menu from "@mui/material/Menu";
|
||||
import Tooltip from "@mui/material/Tooltip";
|
||||
import MenuItem from "@mui/material/MenuItem";
|
||||
import Typography from "@mui/material/Typography";
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
import SettingsIcon from "@mui/icons-material/Settings";
|
||||
import { useTheme } from "@mui/material/styles";
|
||||
|
||||
const settings = [
|
||||
"Open Site",
|
||||
"Detailed View",
|
||||
"Incidents",
|
||||
"Configure",
|
||||
"Remove",
|
||||
];
|
||||
|
||||
/**
|
||||
* DashboardSettings component
|
||||
*
|
||||
* A component that provides a settings menu accessible from an icon.
|
||||
*
|
||||
* @component
|
||||
* @example
|
||||
* return (
|
||||
* <DashboardSettings />
|
||||
* )
|
||||
*/
|
||||
function DashboardSettings() {
|
||||
const theme = useTheme();
|
||||
const [anchorElUser, setAnchorElUser] = useState(null);
|
||||
|
||||
/**
|
||||
* Handles opening the user menu.
|
||||
*
|
||||
* @param {React.MouseEvent<HTMLElement>} event - The event triggered by clicking the user menu button.
|
||||
*/
|
||||
const handleOpenUserMenu = (event) => {
|
||||
setAnchorElUser(event.currentTarget);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles closing the user menu.
|
||||
*/
|
||||
const handleCloseUserMenu = () => {
|
||||
setAnchorElUser(null);
|
||||
};
|
||||
|
||||
return (
|
||||
<Box sx={{ flexGrow: 0 }}>
|
||||
<Tooltip title="Open settings">
|
||||
<IconButton onClick={handleOpenUserMenu} sx={{ p: 0 }}>
|
||||
<SvgIcon component={SettingsIcon} />
|
||||
</IconButton>
|
||||
</Tooltip>
|
||||
<Menu
|
||||
sx={{ mt: theme.spacing(5.5) }}
|
||||
id="menu-appbar"
|
||||
anchorEl={anchorElUser}
|
||||
anchorOrigin={{
|
||||
vertical: "top",
|
||||
horizontal: "right",
|
||||
}}
|
||||
keepMounted
|
||||
transformOrigin={{
|
||||
vertical: "top",
|
||||
horizontal: "right",
|
||||
}}
|
||||
open={Boolean(anchorElUser)}
|
||||
onClose={handleCloseUserMenu}
|
||||
>
|
||||
{settings.map((setting) => (
|
||||
<MenuItem
|
||||
id="dashboard-setting-menu-item"
|
||||
key={setting}
|
||||
onClick={handleCloseUserMenu}
|
||||
>
|
||||
<Typography
|
||||
style={{ fontSize: "var(--env-var-font-size-medium)" }}
|
||||
textAlign="center"
|
||||
>
|
||||
{setting}
|
||||
</Typography>
|
||||
</MenuItem>
|
||||
))}
|
||||
</Menu>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
export default DashboardSettings;
|
||||
@@ -0,0 +1,30 @@
|
||||
.dashboard-sidebar {
|
||||
height: calc(100vh - 64px);
|
||||
width: 250px;
|
||||
border: 1px solid var(--color-border-0);
|
||||
border-top: none;
|
||||
border-bottom: none;
|
||||
top: 64px;
|
||||
position: sticky;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.support-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 28px 35px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.support-text {
|
||||
font-size: var(--env-var-font-size-medium);
|
||||
color: var(--env-var-color-12);
|
||||
}
|
||||
|
||||
.support-icon {
|
||||
width: var(--env-var-img-width-1);
|
||||
margin-right: 8px;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import DashboardMenu from "../DashboardMenu";
|
||||
import SvgIcon from "@mui/material/SvgIcon";
|
||||
import "./index.css";
|
||||
import SupportIcon from "../../../assets/Images/Icon-support-gray.png";
|
||||
|
||||
/**
|
||||
* @component
|
||||
* DashboardSidebar component serves as a sidebar containing the DashboardMenu and a Support icon at the bottom.
|
||||
*
|
||||
* @returns {JSX.Element} The JSX element representing the DashboardSidebar component.
|
||||
*/
|
||||
|
||||
function DashboardSidebar() {
|
||||
return (
|
||||
<div className="dashboard-sidebar">
|
||||
<div className="menu-container">
|
||||
<DashboardMenu />
|
||||
</div>
|
||||
<div className="support-container">
|
||||
<img className="support-icon" src={SupportIcon} alt="SupportIcon" />
|
||||
<span className="support-text">Support</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default DashboardSidebar;
|
||||
Reference in new issue
Block a user