ui: display overlay when no machines available
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
source_up
|
source_up
|
||||||
|
|
||||||
files=(flake-module.nix package.json package-lock.json)
|
files=(../../flake.nix ../theme default.nix flake-module.nix package.json package-lock.json)
|
||||||
if type nix_direnv_watch_file &>/dev/null; then
|
if type nix_direnv_watch_file &>/dev/null; then
|
||||||
nix_direnv_watch_file "${files[@]}"
|
nix_direnv_watch_file "${files[@]}"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export function NoDataOverlay(props: NoDataOverlayProps) {
|
|||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
<Box sx={{ mt: 1 }}>{label}</Box>
|
<Box sx={{ mt: 1, textAlign: "center" }}>{label}</Box>
|
||||||
</StyledGridOverlay>
|
</StyledGridOverlay>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { visuallyHidden } from "@mui/utils";
|
|||||||
import { NodeRow } from "./nodeRow";
|
import { NodeRow } from "./nodeRow";
|
||||||
|
|
||||||
import { Machine } from "@/api/model/machine";
|
import { Machine } from "@/api/model/machine";
|
||||||
|
import { NoDataOverlay } from "../noDataOverlay";
|
||||||
|
|
||||||
interface HeadCell {
|
interface HeadCell {
|
||||||
disablePadding: boolean;
|
disablePadding: boolean;
|
||||||
@@ -163,6 +164,11 @@ export function NodeTableContainer(props: NodeTableContainerProps) {
|
|||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<TableContainer>
|
<TableContainer>
|
||||||
|
{tableData.length === 0 ? (
|
||||||
|
<div className="my-8 flex w-full items-center justify-center">
|
||||||
|
<NoDataOverlay label={"No Machines"} />
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
<Table aria-labelledby="tableTitle" size={dense ? "small" : "medium"}>
|
<Table aria-labelledby="tableTitle" size={dense ? "small" : "medium"}>
|
||||||
<EnhancedTableHead
|
<EnhancedTableHead
|
||||||
order={order}
|
order={order}
|
||||||
@@ -192,6 +198,7 @@ export function NodeTableContainer(props: NodeTableContainerProps) {
|
|||||||
)}
|
)}
|
||||||
</TableBody>
|
</TableBody>
|
||||||
</Table>
|
</Table>
|
||||||
|
)}
|
||||||
</TableContainer>
|
</TableContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user