diff --git a/Client/src/Components/BasicTable/index.css b/Client/src/Components/BasicTable/index.css index a0b00015e..0f0bb7061 100644 --- a/Client/src/Components/BasicTable/index.css +++ b/Client/src/Components/BasicTable/index.css @@ -1,21 +1,25 @@ -.MuiTable-root .host-row { - display: flex; - align-items: center; -} -.MuiTable-root .host-row a { +.MuiTable-root .host a { width: var(--env-var-img-width-2); height: var(--env-var-img-width-2); color: var(--env-var-color-5); margin-right: 10px; margin-bottom: 2px; } -.MuiTable-root .host-row a svg { +.MuiTable-root .host a svg { width: var(--env-var-font-size-large); height: var(--env-var-font-size-large); } -.MuiTable-root .host-row .host-percentage { +.MuiTable-root .host div:nth-child(3) { font-size: var(--env-var-font-size-small); } +.MuiTable-root .host div:nth-child(2) { + width: fit-content; + margin-right: 10px; + font-weight: 700; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; +} .MuiTable-root .label { line-height: 1; @@ -24,15 +28,6 @@ font-size: var(--env-var-font-size-small-plus); } -.MuiTable-root .host-name { - width: fit-content; - margin-right: 10px; - font-weight: 700; - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; -} - .MuiPaper-root:has(table.MuiTable-root) { box-shadow: none; border: solid 1px var(--env-var-color-16); diff --git a/Client/src/Pages/Incidents/index.css b/Client/src/Pages/Incidents/index.css index 9d2ba8ee0..1b1d2f364 100644 --- a/Client/src/Pages/Incidents/index.css +++ b/Client/src/Pages/Incidents/index.css @@ -1,12 +1,16 @@ -.incidents h1.MuiTypography-root { +.incidents h1.MuiTypography-root, +.incidents p.MuiTypography-root { color: var(--env-var-color-5); } .incidents h1.MuiTypography-root { font-size: var(--env-var-font-size-large); font-weight: 600; } -.incidents button.MuiButtonBase-root { +.incidents button.MuiButtonBase-root, +.incidents p.MuiTypography-root { font-size: var(--env-var-font-size-medium); +} +.incidents button.MuiButtonBase-root { height: 34px; border-color: var(--env-var-color-16); } @@ -14,4 +18,4 @@ /* remove later */ .incidents .MuiSelect-select { padding: 0 10px; -} \ No newline at end of file +} diff --git a/Client/src/Pages/Incidents/index.jsx b/Client/src/Pages/Incidents/index.jsx index 72ecef9dd..e245e0b6c 100644 --- a/Client/src/Pages/Incidents/index.jsx +++ b/Client/src/Pages/Incidents/index.jsx @@ -1,18 +1,20 @@ import { useState, useEffect } from "react"; import { useSelector } from "react-redux"; -import { Typography, ButtonGroup, Stack } from "@mui/material"; - +import { Typography, ButtonGroup, Stack, Box } from "@mui/material"; +import WestRoundedIcon from "@mui/icons-material/WestRounded"; import Button from "../../Components/Button"; import axiosInstance from "../../Utils/axiosConfig"; import BasicTable from "../../Components/BasicTable"; import { StatusLabel } from "../../Components/Label"; import { useTheme } from "@emotion/react"; +import { useNavigate } from "react-router"; +import Select from "../../Components/Inputs/Select"; import "./index.css"; -import Select from "../../Components/Inputs/Select"; const Incidents = () => { const theme = useTheme(); + const navigate = useNavigate(); const authState = useSelector((state) => state.auth); const [monitors, setMonitors] = useState({}); const [selectedMonitor, setSelectedMonitor] = useState("0"); @@ -58,13 +60,19 @@ const Incidents = () => { setSelectedMonitor(event.target.value); }; let incidents = []; + let hasAnyIncidents = false; + let hasSpecificIncidents = false; if (selectedMonitor === "0") { Object.values(monitors).forEach((monitor) => { incidents = incidents.concat(monitor.checks); }); + if (incidents.length !== 0) hasAnyIncidents = true; + hasSpecificIncidents = hasAnyIncidents; } else { const monitor = monitors[selectedMonitor]; incidents = monitor.checks; + if (incidents.length !== 0) hasSpecificIncidents = true; + hasAnyIncidents = true; } incidents = incidents .sort((a, b) => { @@ -92,48 +100,83 @@ const Incidents = () => { data.rows = incidents; return ( - - - Incident history for: - + {hasAnyIncidents && hasSpecificIncidents && ( + +