2026-02-06 18:20:26 +00:00
|
|
|
import Stack from "@mui/material/Stack";
|
2026-04-25 23:27:35 -04:00
|
|
|
import Typography from "@mui/material/Typography";
|
2026-02-06 18:56:10 +00:00
|
|
|
import { Stats } from "@/Pages/Logs/components/Stats";
|
2026-05-26 13:32:48 -07:00
|
|
|
import { MongoStats } from "@/Pages/Logs/components/MongoStats";
|
2026-05-26 14:55:22 -07:00
|
|
|
import { MongoCollectionStats } from "./components/MongoCollectionStats";
|
2026-02-06 18:56:10 +00:00
|
|
|
import { StatGauges } from "@/Pages/Logs/components/StatGauges";
|
2026-02-06 18:20:26 +00:00
|
|
|
|
|
|
|
|
import { useTheme } from "@mui/material";
|
2026-04-25 23:27:35 -04:00
|
|
|
import { useTranslation } from "react-i18next";
|
2026-02-06 18:20:26 +00:00
|
|
|
import { useGet } from "@/Hooks/UseApi";
|
|
|
|
|
import type { Diagnostics } from "@/Types/Diagnostics";
|
2026-05-26 15:09:33 -07:00
|
|
|
import { LAYOUT, SPACING } from "@/Utils/Theme/constants";
|
2026-02-06 18:20:26 +00:00
|
|
|
|
2026-02-05 20:23:04 +00:00
|
|
|
export const TabDiagnostics = () => {
|
2026-02-06 18:20:26 +00:00
|
|
|
const theme = useTheme();
|
2026-04-25 23:27:35 -04:00
|
|
|
const { t } = useTranslation();
|
2026-02-06 18:20:26 +00:00
|
|
|
const {
|
|
|
|
|
data: diagnostics,
|
2026-02-06 18:46:06 +00:00
|
|
|
isLoading: _isLoading,
|
|
|
|
|
error: _error,
|
|
|
|
|
refetch: _refetch,
|
|
|
|
|
} = useGet<Diagnostics>("/diagnostic/system", {}, { refreshInterval: 5000 });
|
2026-02-06 18:20:26 +00:00
|
|
|
|
|
|
|
|
return (
|
2026-05-26 15:09:33 -07:00
|
|
|
<Stack gap={theme.spacing(LAYOUT.XL)}>
|
|
|
|
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
|
|
|
|
<Stack gap={theme.spacing(SPACING.SM)}>
|
2026-04-25 23:27:35 -04:00
|
|
|
<Typography
|
2026-04-26 01:55:33 -04:00
|
|
|
variant="eyebrow"
|
2026-05-26 13:32:48 -07:00
|
|
|
color={theme.palette.text.secondary}
|
2026-04-25 23:27:35 -04:00
|
|
|
>
|
|
|
|
|
{t("pages.logs.diagnostics.sections.runtimeStats.title")}
|
|
|
|
|
</Typography>
|
|
|
|
|
<Typography color={theme.palette.text.secondary}>
|
|
|
|
|
{t("pages.logs.diagnostics.sections.runtimeStats.description")}
|
|
|
|
|
</Typography>
|
|
|
|
|
</Stack>
|
|
|
|
|
<Stats diagnostics={diagnostics} />
|
|
|
|
|
</Stack>
|
2026-05-26 15:09:33 -07:00
|
|
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
|
|
|
|
<Stack gap={theme.spacing(SPACING.SM)}>
|
2026-04-25 23:27:35 -04:00
|
|
|
<Typography
|
2026-04-26 01:55:33 -04:00
|
|
|
variant="eyebrow"
|
2026-05-26 13:32:48 -07:00
|
|
|
color={theme.palette.text.secondary}
|
2026-04-25 23:27:35 -04:00
|
|
|
>
|
|
|
|
|
{t("pages.logs.diagnostics.sections.memoryCpu.title")}
|
|
|
|
|
</Typography>
|
|
|
|
|
<Typography color={theme.palette.text.secondary}>
|
|
|
|
|
{t("pages.logs.diagnostics.sections.memoryCpu.description")}
|
|
|
|
|
</Typography>
|
|
|
|
|
</Stack>
|
|
|
|
|
<StatGauges diagnostics={diagnostics} />
|
|
|
|
|
</Stack>
|
2026-05-26 15:09:33 -07:00
|
|
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
2026-05-26 14:55:22 -07:00
|
|
|
<Typography
|
|
|
|
|
variant="eyebrow"
|
|
|
|
|
color={theme.palette.text.secondary}
|
|
|
|
|
>
|
2026-05-26 15:09:33 -07:00
|
|
|
{t("pages.logs.diagnostics.sections.mongoDBStats.title")}
|
2026-05-26 14:55:22 -07:00
|
|
|
</Typography>
|
|
|
|
|
<Typography color={theme.palette.text.secondary}>
|
2026-05-26 15:09:33 -07:00
|
|
|
{t("pages.logs.diagnostics.sections.mongoDBStats.description")}
|
2026-05-26 14:55:22 -07:00
|
|
|
</Typography>
|
2026-05-26 13:32:48 -07:00
|
|
|
<MongoStats diagnostics={diagnostics} />
|
|
|
|
|
</Stack>
|
2026-05-26 15:09:33 -07:00
|
|
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
2026-05-26 14:55:22 -07:00
|
|
|
<Typography
|
|
|
|
|
variant="eyebrow"
|
|
|
|
|
color={theme.palette.text.secondary}
|
|
|
|
|
>
|
2026-05-26 15:09:33 -07:00
|
|
|
{t("pages.logs.diagnostics.sections.mongoDBCollectionStats.title")}
|
2026-05-26 14:55:22 -07:00
|
|
|
</Typography>
|
|
|
|
|
<Typography color={theme.palette.text.secondary}>
|
2026-05-26 15:09:33 -07:00
|
|
|
{t("pages.logs.diagnostics.sections.mongoDBCollectionStats.description")}
|
2026-05-26 14:55:22 -07:00
|
|
|
</Typography>
|
|
|
|
|
<MongoCollectionStats diagnostics={diagnostics} />
|
|
|
|
|
</Stack>
|
2026-02-06 18:20:26 +00:00
|
|
|
</Stack>
|
|
|
|
|
);
|
2026-02-05 20:23:04 +00:00
|
|
|
};
|