add error icon
This commit is contained in:
1 parent
befdf73706
commit
74b7d7c4a5
1 file changed
+9
-4
@@ -3,6 +3,7 @@ import { Typography, Stack, Box } from "@mui/material";
|
|||||||
import GenericFallback from "../../../Components/GenericFallback";
|
import GenericFallback from "../../../Components/GenericFallback";
|
||||||
import Fallback from "../../../Components/Fallback";
|
import Fallback from "../../../Components/Fallback";
|
||||||
import CheckCircleIcon from "@mui/icons-material/CheckCircle";
|
import CheckCircleIcon from "@mui/icons-material/CheckCircle";
|
||||||
|
import ErrorOutlineIcon from "@mui/icons-material/ErrorOutline";
|
||||||
import ControlsHeader from "./Components/ControlsHeader";
|
import ControlsHeader from "./Components/ControlsHeader";
|
||||||
import SkeletonLayout from "./Components/Skeleton";
|
import SkeletonLayout from "./Components/Skeleton";
|
||||||
import StatusBar from "./Components/StatusBar";
|
import StatusBar from "./Components/StatusBar";
|
||||||
@@ -12,7 +13,6 @@ import { useState, useEffect } from "react";
|
|||||||
import { useStatusPageFetch } from "./Hooks/useStatusPageFetch";
|
import { useStatusPageFetch } from "./Hooks/useStatusPageFetch";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
|
import { useIsAdmin } from "../../../Hooks/useIsAdmin";
|
||||||
import useUtils from "../../Uptime/Monitors/Hooks/useUtils";
|
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useStatusPageDelete } from "./Hooks/useStatusPageDelete";
|
import { useStatusPageDelete } from "./Hooks/useStatusPageDelete";
|
||||||
@@ -27,10 +27,9 @@ const PublicStatus = () => {
|
|||||||
const [statusPage, monitors, isLoading, networkError, fetchStatusPage] =
|
const [statusPage, monitors, isLoading, networkError, fetchStatusPage] =
|
||||||
useStatusPageFetch();
|
useStatusPageFetch();
|
||||||
const [deleteStatusPage, isDeleting] = useStatusPageDelete(fetchStatusPage);
|
const [deleteStatusPage, isDeleting] = useStatusPageDelete(fetchStatusPage);
|
||||||
|
|
||||||
const { determineState } = useUtils();
|
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
const currentPath = location.pathname;
|
const currentPath = location.pathname;
|
||||||
let sx = { paddingLeft: theme.spacing(20), paddingRight: theme.spacing(20) };
|
let sx = { paddingLeft: theme.spacing(20), paddingRight: theme.spacing(20) };
|
||||||
@@ -68,7 +67,13 @@ const PublicStatus = () => {
|
|||||||
// Effects
|
// Effects
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (typeof monitors === "undefined") return;
|
if (typeof monitors === "undefined") return;
|
||||||
const monitorsStatus = {};
|
const monitorsStatus = {
|
||||||
|
icon: (
|
||||||
|
<ErrorOutlineIcon
|
||||||
|
sx={{ color: theme.palette.primary.contrastTextSecondaryDarkBg }}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
};
|
||||||
if (monitors.every((monitor) => monitor.status === true)) {
|
if (monitors.every((monitor) => monitor.status === true)) {
|
||||||
monitorsStatus.msg = "All systems operational";
|
monitorsStatus.msg = "All systems operational";
|
||||||
monitorsStatus.color = theme.palette.success.lowContrast;
|
monitorsStatus.color = theme.palette.success.lowContrast;
|
||||||
|
|||||||
Reference in new issue
Block a user