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";
|
|
|
|
|
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-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-04-25 23:27:35 -04:00
|
|
|
<Stack gap={theme.spacing(12)}>
|
|
|
|
|
<Stack gap={theme.spacing(4)}>
|
|
|
|
|
<Stack gap={theme.spacing(1)}>
|
|
|
|
|
<Typography
|
2026-04-26 01:55:33 -04:00
|
|
|
variant="eyebrow"
|
|
|
|
|
color="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>
|
|
|
|
|
<Stack gap={theme.spacing(4)}>
|
|
|
|
|
<Stack gap={theme.spacing(1)}>
|
|
|
|
|
<Typography
|
2026-04-26 01:55:33 -04:00
|
|
|
variant="eyebrow"
|
|
|
|
|
color="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-02-06 18:20:26 +00:00
|
|
|
</Stack>
|
|
|
|
|
);
|
2026-02-05 20:23:04 +00:00
|
|
|
};
|