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 ResponseTable from "./Components/ResponseTable";
|
||||
import UptimeStatusBoxes from "./Components/UptimeStatusBoxes";
|
||||
import GenericFallback from "../../../Components/GenericFallback";
|
||||
// MUI Components
|
||||
import { Stack } from "@mui/material";
|
||||
import { Stack, Typography } from "@mui/material";
|
||||
|
||||
// Utils
|
||||
import { useState } from "react";
|
||||
@@ -77,6 +78,24 @@ const UptimeDetails = () => {
|
||||
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 (
|
||||
<Stack gap={theme.spacing(10)}>
|
||||
<Breadcrumbs list={BREADCRUMBS} />
|
||||
|
||||
@@ -112,7 +112,6 @@ const UptimeMonitors = () => {
|
||||
if (networkError) {
|
||||
return (
|
||||
<GenericFallback>
|
||||
{" "}
|
||||
<Typography
|
||||
variant="h1"
|
||||
marginY={theme.spacing(4)}
|
||||
@@ -135,7 +134,6 @@ const UptimeMonitors = () => {
|
||||
/>
|
||||
);
|
||||
}
|
||||
console.log({ isLoading });
|
||||
|
||||
return (
|
||||
<Stack
|
||||
|
||||
Reference in new issue
Block a user