implement docker host details page
This commit is contained in:
1 parent
a7ee90e1ee
commit
ca896fa22f
14 files changed
+366
-17
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import Stack from "@mui/material/Stack";
|
||||
import { StatBox } from "@/Components/design-elements";
|
||||
|
||||
// Types
|
||||
import type { DockerStats } from "@/Types/Monitor";
|
||||
|
||||
// Hooks
|
||||
import { useTheme } from "@mui/material";
|
||||
import { useTranslation } from "react-i18next";
|
||||
|
||||
// Utils
|
||||
import prettyBytes from "pretty-bytes";
|
||||
|
||||
export const DockerStatusBoxes = ({ stats }: { stats: DockerStats | undefined }) => {
|
||||
const { t } = useTranslation();
|
||||
const theme = useTheme();
|
||||
|
||||
if (!stats) return null;
|
||||
|
||||
const { total, running, stopped, unhealthy } = stats.latest?.summary ?? {};
|
||||
|
||||
return (
|
||||
<Stack
|
||||
direction="row"
|
||||
gap={theme.spacing(8)}
|
||||
flexWrap={"wrap"}
|
||||
>
|
||||
<StatBox
|
||||
title={"Containers"}
|
||||
subtitle={String(total)}
|
||||
/>
|
||||
<StatBox
|
||||
title={"Running"}
|
||||
subtitle={String(running)}
|
||||
/>
|
||||
|
||||
<StatBox
|
||||
title={"Stopped"}
|
||||
subtitle={String(stopped)}
|
||||
/>
|
||||
|
||||
<StatBox
|
||||
title={"Unhealthy"}
|
||||
subtitle={String(unhealthy)}
|
||||
/>
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user