Added loading skeleton and small styling changes
This commit is contained in:
1 parent
26e3f81a91
commit
761c60f3bb
3 files changed
+55
-49
No files matched your search
@@ -85,10 +85,6 @@ const IncidentTable = ({ monitors, selectedMonitor, filter }) => {
|
|||||||
"&:focus": {
|
"&:focus": {
|
||||||
outline: "none",
|
outline: "none",
|
||||||
},
|
},
|
||||||
"& .MuiTouchRipple-root": {
|
|
||||||
pointerEvents: "none",
|
|
||||||
display: "none",
|
|
||||||
},
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -14,6 +14,9 @@
|
|||||||
height: 34px;
|
height: 34px;
|
||||||
border-color: var(--env-var-color-16);
|
border-color: var(--env-var-color-16);
|
||||||
}
|
}
|
||||||
|
.incidents .MuiPagination-root {
|
||||||
|
background-color: var(--env-var-color-8);
|
||||||
|
}
|
||||||
|
|
||||||
/* remove later */
|
/* remove later */
|
||||||
.incidents .MuiSelect-select {
|
.incidents .MuiSelect-select {
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { ButtonGroup, Stack, Skeleton } from "@mui/material";
|
import { ButtonGroup, Stack, Skeleton, Typography } from "@mui/material";
|
||||||
import Button from "../../Components/Button";
|
import Button from "../../Components/Button";
|
||||||
import axiosInstance from "../../Utils/axiosConfig";
|
import axiosInstance from "../../Utils/axiosConfig";
|
||||||
import { useTheme } from "@emotion/react";
|
import { useTheme } from "@emotion/react";
|
||||||
import { useNavigate } from "react-router";
|
|
||||||
import Select from "../../Components/Inputs/Select";
|
import Select from "../../Components/Inputs/Select";
|
||||||
import IncidentTable from "./IncidentTable";
|
import IncidentTable from "./IncidentTable";
|
||||||
import "./index.css";
|
import "./index.css";
|
||||||
@@ -37,7 +36,6 @@ const SkeletonLayout = () => {
|
|||||||
|
|
||||||
const Incidents = () => {
|
const Incidents = () => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const navigate = useNavigate();
|
|
||||||
const authState = useSelector((state) => state.auth);
|
const authState = useSelector((state) => state.auth);
|
||||||
|
|
||||||
const [monitors, setMonitors] = useState({});
|
const [monitors, setMonitors] = useState({});
|
||||||
@@ -81,49 +79,58 @@ const Incidents = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack className="incidents" gap={theme.gap.large}>
|
<Stack className="incidents" gap={theme.gap.large}>
|
||||||
<Stack direction="row" alignItems="center" gap={theme.gap.medium}>
|
{loading ? (
|
||||||
<Select
|
<SkeletonLayout />
|
||||||
id="incidents-select-monitor"
|
) : (
|
||||||
placeholder="All servers"
|
<>
|
||||||
value={selectedMonitor}
|
<Stack direction="row" alignItems="center" gap={theme.gap.medium}>
|
||||||
onChange={handleSelect}
|
<Typography display="inline-block" component="h1">
|
||||||
items={Object.values(monitors)}
|
Incidents for
|
||||||
/>
|
</Typography>
|
||||||
<ButtonGroup sx={{ ml: "auto" }}>
|
<Select
|
||||||
<Button
|
id="incidents-select-monitor"
|
||||||
level="secondary"
|
placeholder="All servers"
|
||||||
label="All"
|
value={selectedMonitor}
|
||||||
onClick={() => setFilter("all")}
|
onChange={handleSelect}
|
||||||
sx={{
|
items={Object.values(monitors)}
|
||||||
backgroundColor:
|
/>
|
||||||
filter === "all" && theme.palette.otherColors.fillGray,
|
<ButtonGroup sx={{ ml: "auto" }}>
|
||||||
}}
|
<Button
|
||||||
|
level="secondary"
|
||||||
|
label="All"
|
||||||
|
onClick={() => setFilter("all")}
|
||||||
|
sx={{
|
||||||
|
backgroundColor:
|
||||||
|
filter === "all" && theme.palette.otherColors.fillGray,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
level="secondary"
|
||||||
|
label="Down"
|
||||||
|
onClick={() => setFilter("down")}
|
||||||
|
sx={{
|
||||||
|
backgroundColor:
|
||||||
|
filter === "down" && theme.palette.otherColors.fillGray,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
level="secondary"
|
||||||
|
label="Cannot Resolve"
|
||||||
|
onClick={() => setFilter("resolve")}
|
||||||
|
sx={{
|
||||||
|
backgroundColor:
|
||||||
|
filter === "resolve" && theme.palette.otherColors.fillGray,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</ButtonGroup>
|
||||||
|
</Stack>
|
||||||
|
<IncidentTable
|
||||||
|
monitors={monitors}
|
||||||
|
selectedMonitor={selectedMonitor}
|
||||||
|
filter={filter}
|
||||||
/>
|
/>
|
||||||
<Button
|
</>
|
||||||
level="secondary"
|
)}
|
||||||
label="Down"
|
|
||||||
onClick={() => setFilter("down")}
|
|
||||||
sx={{
|
|
||||||
backgroundColor:
|
|
||||||
filter === "down" && theme.palette.otherColors.fillGray,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
level="secondary"
|
|
||||||
label="Cannot Resolve"
|
|
||||||
onClick={() => setFilter("resolve")}
|
|
||||||
sx={{
|
|
||||||
backgroundColor:
|
|
||||||
filter === "resolve" && theme.palette.otherColors.fillGray,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ButtonGroup>
|
|
||||||
</Stack>
|
|
||||||
<IncidentTable
|
|
||||||
monitors={monitors}
|
|
||||||
selectedMonitor={selectedMonitor}
|
|
||||||
filter={filter}
|
|
||||||
/>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user