docker, infra, and pagespeed

This commit is contained in:
Alex Holliday committed 2026-01-02 20:53:50 +00:00
1 parent 8e6a8e5a06
commit 82cb59ae9e
6 files changed
+26 -7

No files matched your search

@@ -61,6 +61,7 @@ const InfraMonitorsPage = () => {
}
);
const monitors: IMonitor[] = response?.data?.monitors ?? ([] as IMonitor[]);
const checksMap = response?.data?.checksMap || {};
const count = response?.data?.count || 0;
const upCount = response?.data?.upCount || 0;
const downCount = response?.data?.downCount || 0;
@@ -107,6 +108,7 @@ const InfraMonitorsPage = () => {
</Stack>
<InfraMonitorsTable
monitors={monitors}
checksMap={checksMap}
refetch={refetch}
setSelectedMonitor={setSelectedMonitor}
sortField={sortField}
@@ -12,11 +12,13 @@ import { useTheme } from "@mui/material/styles";
import { useNavigate } from "react-router-dom";
import { usePatch } from "@/hooks/UseApi";
import type { ICheck } from "@/types/check";
import type { IMonitor } from "@/types/monitor";
import type { ActionMenuItem } from "@/components/actions-menu";
export const InfraMonitorsTable = ({
monitors,
checksMap,
refetch,
setSelectedMonitor,
sortField,
@@ -30,6 +32,7 @@ export const InfraMonitorsTable = ({
setRowsPerPage,
}: {
monitors: IMonitor[];
checksMap: Record<string, ICheck[]>;
refetch: Function;
setSelectedMonitor: Function;
sortField: string;
@@ -194,7 +197,9 @@ export const InfraMonitorsTable = ({
),
render: (row) => {
return (
<StatusLabel status={(row.status as any) ?? ("initializing" as any)} />
<StatusLabel
status={(row.status as any) ?? ("initializing" as any)}
/>
);
},
},
@@ -203,7 +208,7 @@ export const InfraMonitorsTable = ({
content: t("monitors.infrastructure.table.headers.cpu"),
render: (row) => {
const cpuUsage =
(row.latestChecks?.[0]?.system?.cpu?.usage_percent || 0) * 100;
(checksMap[row._id]?.[0]?.system?.cpu?.usage_percent || 0) * 100;
return <Gauge progress={cpuUsage} />;
},
},
@@ -212,7 +217,7 @@ export const InfraMonitorsTable = ({
content: t("monitors.infrastructure.table.headers.memory"),
render: (row) => {
const memoryUsage =
(row.latestChecks?.[0]?.system?.memory?.usage_percent || 0) * 100;
(checksMap[row._id]?.[0]?.system?.memory?.usage_percent || 0) * 100;
return <Gauge progress={memoryUsage} />;
},
},
@@ -220,11 +225,11 @@ export const InfraMonitorsTable = ({
id: "disk",
content: t("monitors.infrastructure.table.headers.disk"),
render: (row) => {
const totalDiskUsage = row.latestChecks?.[0]?.system?.disk?.reduce(
const totalDiskUsage = checksMap[row._id]?.[0]?.system?.disk?.reduce(
(acc, disk) => acc + disk.usage_percent,
0
);
const diskCount = row.latestChecks?.[0]?.system?.disk?.length || 1;
const diskCount = checksMap[row._id]?.[0]?.system?.disk?.length || 1;
const diskUsage = ((totalDiskUsage || 0) / diskCount) * 100;
return <Gauge progress={diskUsage} />;
},