moved PublicStatus directory to Status
This commit is contained in:
1 parent
6cedf992a7
commit
51e828c07e
4 files changed
+55
-1
No files matched your search
@@ -0,0 +1,14 @@
|
|||||||
|
import { Stack, Skeleton } from "@mui/material";
|
||||||
|
|
||||||
|
const SkeletonLayout = () => {
|
||||||
|
return (
|
||||||
|
<Stack>
|
||||||
|
<Skeleton
|
||||||
|
variant="rectangular"
|
||||||
|
height={"90vh"}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default SkeletonLayout;
|
||||||
File renamed without changes.
File renamed without changes.
+41
-1
@@ -8,6 +8,8 @@ import Host from "../../Uptime/Monitors/Components/Host";
|
|||||||
import { StatusLabel } from "../../../Components/Label";
|
import { StatusLabel } from "../../../Components/Label";
|
||||||
import SettingsIcon from "../../../assets/icons/settings-bold.svg?react";
|
import SettingsIcon from "../../../assets/icons/settings-bold.svg?react";
|
||||||
import Image from "../../../Components/Image";
|
import Image from "../../../Components/Image";
|
||||||
|
import SkeletonLayout from "./Components/Skeleton";
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { useState, useEffect } from "react";
|
import { useState, useEffect } from "react";
|
||||||
import { useStatusPageFetch } from "./Hooks/useStatusPageFetch";
|
import { useStatusPageFetch } from "./Hooks/useStatusPageFetch";
|
||||||
@@ -17,6 +19,7 @@ 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";
|
||||||
|
|
||||||
const PublicStatus = () => {
|
const PublicStatus = () => {
|
||||||
// Local state
|
// Local state
|
||||||
const [status, setStatus] = useState(undefined);
|
const [status, setStatus] = useState(undefined);
|
||||||
@@ -93,7 +96,9 @@ const PublicStatus = () => {
|
|||||||
setStatus(monitorsStatus);
|
setStatus(monitorsStatus);
|
||||||
}, [monitors, theme]);
|
}, [monitors, theme]);
|
||||||
|
|
||||||
//Handlers
|
if (isLoading) {
|
||||||
|
return <SkeletonLayout />;
|
||||||
|
}
|
||||||
|
|
||||||
if (networkError === true) {
|
if (networkError === true) {
|
||||||
return (
|
return (
|
||||||
@@ -110,6 +115,23 @@ const PublicStatus = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isLoading && typeof status === "undefined" && currentPath === "/status/public") {
|
||||||
|
return (
|
||||||
|
<Stack sx={sx}>
|
||||||
|
<GenericFallback>
|
||||||
|
<Typography
|
||||||
|
variant="h1"
|
||||||
|
marginY={theme.spacing(4)}
|
||||||
|
color={theme.palette.primary.contrastTextTertiary}
|
||||||
|
>
|
||||||
|
A public status page is not set up.
|
||||||
|
</Typography>
|
||||||
|
<Typography>Please contact to your administrator</Typography>
|
||||||
|
</GenericFallback>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isLoading && typeof statusPage === "undefined") {
|
if (!isLoading && typeof statusPage === "undefined") {
|
||||||
return (
|
return (
|
||||||
<Fallback
|
<Fallback
|
||||||
@@ -124,6 +146,23 @@ const PublicStatus = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isLoading && statusPage.isPublic === false) {
|
||||||
|
return (
|
||||||
|
<Stack sx={sx}>
|
||||||
|
<GenericFallback>
|
||||||
|
<Typography
|
||||||
|
variant="h1"
|
||||||
|
marginY={theme.spacing(4)}
|
||||||
|
color={theme.palette.primary.contrastTextTertiary}
|
||||||
|
>
|
||||||
|
This status page is not public.
|
||||||
|
</Typography>
|
||||||
|
<Typography>Please contact to your administrator</Typography>
|
||||||
|
</GenericFallback>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
gap={theme.spacing(10)}
|
gap={theme.spacing(10)}
|
||||||
@@ -163,6 +202,7 @@ const PublicStatus = () => {
|
|||||||
variant="contained"
|
variant="contained"
|
||||||
color="error"
|
color="error"
|
||||||
onClick={deleteStatusPage}
|
onClick={deleteStatusPage}
|
||||||
|
loading={isDeleting}
|
||||||
>
|
>
|
||||||
Delete
|
Delete
|
||||||
</Button>
|
</Button>
|
||||||
Reference in new issue
Block a user