Merge pull request #1789 from bluewave-labs/fix/fe/maintenance-background
Fix Maintenance page layout issue
This commit is contained in:
1 file changed
+45
-59
@@ -42,66 +42,52 @@ const Maintenance = () => {
|
|||||||
fetchMaintenanceWindows();
|
fetchMaintenanceWindows();
|
||||||
}, [page, rowsPerPage, updateTrigger]);
|
}, [page, rowsPerPage, updateTrigger]);
|
||||||
|
|
||||||
|
if (maintenanceWindows.length === 0) {
|
||||||
|
return (
|
||||||
|
<Fallback
|
||||||
|
title="maintenance window"
|
||||||
|
checks={[
|
||||||
|
"Mark your maintenance periods",
|
||||||
|
"Eliminate any misunderstandings",
|
||||||
|
"Stop sending alerts in maintenance windows",
|
||||||
|
]}
|
||||||
|
link="/maintenance/create"
|
||||||
|
isAdmin={isAdmin}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Stack gap={theme.spacing(10)}>
|
||||||
className="maintenance table-container"
|
<Stack
|
||||||
sx={{
|
direction="row"
|
||||||
':has(> [class*="fallback__"])': {
|
justifyContent="space-between"
|
||||||
position: "relative",
|
alignItems="center"
|
||||||
border: 1,
|
mt={theme.spacing(5)}
|
||||||
borderColor: theme.palette.primary.lowContrast,
|
>
|
||||||
borderRadius: theme.shape.borderRadius,
|
<Breadcrumbs list={[{ name: "maintenance", path: "/maintenance" }]} />
|
||||||
borderStyle: "dashed",
|
<Button
|
||||||
backgroundColor: theme.palette.primary.main,
|
variant="contained"
|
||||||
overflow: "hidden",
|
color="accent"
|
||||||
},
|
onClick={() => {
|
||||||
}}
|
navigate("/maintenance/create");
|
||||||
>
|
}}
|
||||||
{maintenanceWindows.length > 0 && (
|
sx={{ fontWeight: 500 }}
|
||||||
<Stack gap={theme.spacing(8)}>
|
>
|
||||||
<Stack
|
Create maintenance window
|
||||||
direction="row"
|
</Button>
|
||||||
justifyContent="space-between"
|
</Stack>
|
||||||
alignItems="center"
|
<MaintenanceTable
|
||||||
mt={theme.spacing(5)}
|
page={page}
|
||||||
>
|
setPage={setPage}
|
||||||
<Breadcrumbs list={[{ name: "maintenance", path: "/maintenance" }]} />
|
rowsPerPage={rowsPerPage}
|
||||||
<Button
|
sort={sort}
|
||||||
variant="contained"
|
setSort={setSort}
|
||||||
color="accent"
|
maintenanceWindows={maintenanceWindows}
|
||||||
onClick={() => {
|
maintenanceWindowCount={maintenanceWindowCount}
|
||||||
navigate("/maintenance/create");
|
updateCallback={handleActionMenuDelete}
|
||||||
}}
|
/>
|
||||||
sx={{ fontWeight: 500 }}
|
</Stack>
|
||||||
>
|
|
||||||
Create maintenance window
|
|
||||||
</Button>
|
|
||||||
</Stack>
|
|
||||||
<MaintenanceTable
|
|
||||||
page={page}
|
|
||||||
setPage={setPage}
|
|
||||||
rowsPerPage={rowsPerPage}
|
|
||||||
sort={sort}
|
|
||||||
setSort={setSort}
|
|
||||||
maintenanceWindows={maintenanceWindows}
|
|
||||||
maintenanceWindowCount={maintenanceWindowCount}
|
|
||||||
updateCallback={handleActionMenuDelete}
|
|
||||||
/>
|
|
||||||
</Stack>
|
|
||||||
)}
|
|
||||||
{maintenanceWindows.length === 0 && (
|
|
||||||
<Fallback
|
|
||||||
title="maintenance window"
|
|
||||||
checks={[
|
|
||||||
"Mark your maintenance periods",
|
|
||||||
"Eliminate any misunderstandings",
|
|
||||||
"Stop sending alerts in maintenance windows",
|
|
||||||
]}
|
|
||||||
link="/maintenance/create"
|
|
||||||
isAdmin={isAdmin}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Box>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user