diff --git a/Client/src/Pages/Incidents/index.jsx b/Client/src/Pages/Incidents/index.jsx
index 399a0a3bc..4c328a364 100644
--- a/Client/src/Pages/Incidents/index.jsx
+++ b/Client/src/Pages/Incidents/index.jsx
@@ -12,6 +12,32 @@ import Select from "../../Components/Inputs/Select";
import "./index.css";
+/**
+ * Renders a skeleton layout.
+ *
+ * @returns {JSX.Element}
+ */
+const SkeletonLayout = () => {
+ const theme = useTheme();
+
+ return (
+ <>
+
+
+
+
+
+
+
+ >
+ );
+};
+
const Incidents = () => {
const theme = useTheme();
const navigate = useNavigate();
@@ -106,20 +132,7 @@ const Incidents = () => {
<>
{loading ? (
- <>
-
-
-
-
-
-
-
- >
+
) : hasAnyIncidents ? (
<>
diff --git a/Client/src/Pages/Monitors/Configure/index.jsx b/Client/src/Pages/Monitors/Configure/index.jsx
index 238021f1d..0df88078f 100644
--- a/Client/src/Pages/Monitors/Configure/index.jsx
+++ b/Client/src/Pages/Monitors/Configure/index.jsx
@@ -36,6 +36,54 @@ const parseUrl = (url) => {
}
};
+/**
+ * Renders a skeleton layout.
+ *
+ * @returns {JSX.Element}
+ */
+const SkeletonLayout = () => {
+ const theme = useTheme();
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
/**
* Configure page displays monitor configurations and allows for editing actions.
* @component
@@ -169,56 +217,35 @@ const Configure = () => {
return (
{loading ? (
-
+
) : (
- }
- onClick={() => navigate(-1)}
- sx={{
- backgroundColor: "#f4f4f4",
- px: theme.gap.ml,
- "& svg.MuiSvgIcon-root": {
- mr: theme.gap.small,
- fill: theme.palette.otherColors.slateGray,
- },
- }}
- />
- )}
-
+
{
/>
- >
- )}
-
- {loading ? (
-
- ) : (
-
- )}
-
-
+
+
+
+
+ >
+ )}
{
+ const theme = useTheme();
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
/**
* Details page component displaying monitor details and related information.
* @component
@@ -168,49 +238,28 @@ const DetailsPage = () => {
return (
{loading ? (
-
+
) : (
- }
- onClick={() => navigate("/monitors")}
- sx={{
- backgroundColor: "#f4f4f4",
- px: theme.gap.ml,
- "& svg.MuiSvgIcon-root": {
- mr: theme.gap.small,
- fill: theme.palette.otherColors.slateGray,
- },
- }}
- />
- )}
-
-
- {loading ? (
-
- ) : monitor?.status ? (
-
- ) : (
-
- )}
-
- {loading ? (
- <>
-
-
- >
- ) : (
- <>
+ <>
+ }
+ onClick={() => navigate("/monitors")}
+ sx={{
+ backgroundColor: "#f4f4f4",
+ px: theme.gap.ml,
+ "& svg.MuiSvgIcon-root": {
+ mr: theme.gap.small,
+ fill: theme.palette.otherColors.slateGray,
+ },
+ }}
+ />
+
+
+ {monitor?.status ? : }
+
{monitor.url?.replace(/^https?:\/\//, "") || "..."}
@@ -229,55 +278,36 @@ const DetailsPage = () => {
Last time checked{" "}
{formatDurationRounded(getLastChecked(monitor?.checks))} ago.
- >
- )}
-
- {loading ? (
-
- ) : (
-
- }
- onClick={() => navigate(`/monitors/configure/${monitorId}`)}
- sx={{
- ml: "auto",
- alignSelf: "flex-end",
- backgroundColor: "#f4f4f4",
- px: theme.gap.medium,
- "& svg": {
- mr: "6px",
- },
- }}
- />
- )}
-
-
- {loading ? (
- <>
-
-
-
- >
- ) : (
- <>
+
+
+ }
+ onClick={() => navigate(`/monitors/configure/${monitorId}`)}
+ sx={{
+ ml: "auto",
+ alignSelf: "flex-end",
+ backgroundColor: "#f4f4f4",
+ px: theme.gap.medium,
+ "& svg": {
+ mr: "6px",
+ },
+ }}
+ />
+
+
{
title="Incidents"
value={countIncidents(monitor.checks)}
/>
- >
- )}
-
-
-
- {loading ? (
- <>
-
-
- >
- ) : (
- <>
+
+
+
Response Times
@@ -344,35 +360,21 @@ const DetailsPage = () => {
}}
/>
- >
- )}
-
-
- {loading ? (
-
- ) : (
-
- )}
-
-
-
- {loading ? (
- <>
-
-
-
- >
- ) : (
- <>
+
+
+
+
+
+
History
- >
- )}
-
-
+
+
+ >
+ )}
);
};
diff --git a/Client/src/Pages/Monitors/index.jsx b/Client/src/Pages/Monitors/index.jsx
index 82e53ba6b..33828c908 100644
--- a/Client/src/Pages/Monitors/index.jsx
+++ b/Client/src/Pages/Monitors/index.jsx
@@ -72,6 +72,38 @@ const Host = ({ params }) => {
);
};
+/**
+ * Renders a skeleton layout.
+ *
+ * @returns {JSX.Element}
+ */
+const SkeletonLayout = () => {
+ const theme = useTheme();
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ >
+ );
+};
+
const Monitors = () => {
const theme = useTheme();
const navigate = useNavigate();
@@ -205,18 +237,19 @@ const Monitors = () => {
};
});
- let loading = monitorState.isLoading && monitorState.monitors.length === 0;
+ let loading = monitorState.isLoading && monitorState.monitors.length === 0;
return (
-
- {loading ? (
- <>
-
-
- >
- ) : (
- <>
+ {loading ? (
+
+ ) : (
+ <>
+
Hello, {authState.user.firstName}
@@ -227,60 +260,37 @@ const Monitors = () => {
navigate("/monitors/create");
}}
/>
- >
- )}
-
-
- {loading ? (
- <>
-
-
-
- >
- ) : (
- <>
+
+
- >
- )}
-
-
- {loading ? (
-
- ) : (
-
- Current monitors
-
- {monitorState.monitors.length}
-
- {/* TODO - add search bar */}
- )}
- {loading ? (
- <>
-
-
- >
- ) : (
-
- )}
-
+
+
+ Current monitors
+
+ {monitorState.monitors.length}
+
+ {/* TODO - add search bar */}
+
+
+
+ >
+ )}