Merge pull request #1673 from bluewave-labs/fix/fe/uptime-details-empty-views
add empty view for uptime details, resolves #1671
This commit is contained in:
2 files changed
+20
-3
No files matched your search
@@ -6,8 +6,9 @@ import ChartBoxes from "./Components/ChartBoxes";
|
|||||||
import ResponseTimeChart from "./Components/Charts/ResponseTimeChart";
|
import ResponseTimeChart from "./Components/Charts/ResponseTimeChart";
|
||||||
import ResponseTable from "./Components/ResponseTable";
|
import ResponseTable from "./Components/ResponseTable";
|
||||||
import UptimeStatusBoxes from "./Components/UptimeStatusBoxes";
|
import UptimeStatusBoxes from "./Components/UptimeStatusBoxes";
|
||||||
|
import GenericFallback from "../../../Components/GenericFallback";
|
||||||
// MUI Components
|
// MUI Components
|
||||||
import { Stack } from "@mui/material";
|
import { Stack, Typography } from "@mui/material";
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -77,6 +78,24 @@ const UptimeDetails = () => {
|
|||||||
setRowsPerPage(event.target.value);
|
setRowsPerPage(event.target.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Empty view, displayed when loading is complete and there are no checks
|
||||||
|
if (!monitorIsLoading && !checksAreLoading && checksCount === 0) {
|
||||||
|
return (
|
||||||
|
<Stack gap={theme.spacing(10)}>
|
||||||
|
<Breadcrumbs list={BREADCRUMBS} />
|
||||||
|
<MonitorStatusHeader
|
||||||
|
path={"uptime"}
|
||||||
|
isAdmin={isAdmin}
|
||||||
|
shouldRender={!monitorIsLoading}
|
||||||
|
monitor={monitor}
|
||||||
|
/>
|
||||||
|
<GenericFallback>
|
||||||
|
<Typography>There is no history for this monitor yet.</Typography>
|
||||||
|
</GenericFallback>
|
||||||
|
</Stack>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack gap={theme.spacing(10)}>
|
<Stack gap={theme.spacing(10)}>
|
||||||
<Breadcrumbs list={BREADCRUMBS} />
|
<Breadcrumbs list={BREADCRUMBS} />
|
||||||
|
|||||||
@@ -112,7 +112,6 @@ const UptimeMonitors = () => {
|
|||||||
if (networkError) {
|
if (networkError) {
|
||||||
return (
|
return (
|
||||||
<GenericFallback>
|
<GenericFallback>
|
||||||
{" "}
|
|
||||||
<Typography
|
<Typography
|
||||||
variant="h1"
|
variant="h1"
|
||||||
marginY={theme.spacing(4)}
|
marginY={theme.spacing(4)}
|
||||||
@@ -135,7 +134,6 @@ const UptimeMonitors = () => {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
console.log({ isLoading });
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Stack
|
<Stack
|
||||||
|
|||||||
Reference in new issue
Block a user