diff --git a/client/package-lock.json b/client/package-lock.json
index 2dc46148c..74a67958c 100644
--- a/client/package-lock.json
+++ b/client/package-lock.json
@@ -27,7 +27,7 @@
"react-redux": "9.2.0",
"react-router": "7.9.4",
"react-router-dom": "7.9.4",
- "react-toastify": "11.0.5",
+ "react-toastify": "^11.0.5",
"recharts": "2.15.2",
"redux-persist": "6.0.0",
"swr": "2.3.6",
diff --git a/client/package.json b/client/package.json
index 8c4b428a5..4d02090eb 100644
--- a/client/package.json
+++ b/client/package.json
@@ -30,7 +30,7 @@
"react-redux": "9.2.0",
"react-router": "7.9.4",
"react-router-dom": "7.9.4",
- "react-toastify": "11.0.5",
+ "react-toastify": "^11.0.5",
"recharts": "2.15.2",
"redux-persist": "6.0.0",
"swr": "2.3.6",
diff --git a/client/src/components/design-elements/StatusLabel.tsx b/client/src/components/design-elements/StatusLabel.tsx
index 9c32073f8..a22d8bb4c 100644
--- a/client/src/components/design-elements/StatusLabel.tsx
+++ b/client/src/components/design-elements/StatusLabel.tsx
@@ -8,13 +8,7 @@ import { useTheme } from "@mui/material/styles";
export const ValueTypes = ["positive", "negative", "neutral"] as const;
export type ValueType = (typeof ValueTypes)[number];
-export const StatusLabel = ({
- status,
- isActive,
-}: {
- status: MonitorStatus;
- isActive?: boolean;
-}) => {
+export const StatusLabel = ({ status }: { status: MonitorStatus }) => {
const theme = useTheme();
const palette = getStatusPalette(status);
const transformedText =
@@ -42,7 +36,7 @@ export const StatusLabel = ({
borderRadius="50%"
marginRight="5px"
/>
- {isActive === false ? "Paused" : transformedText}
+ {transformedText}
);
};
diff --git a/client/src/components/monitors/HeaderControls.tsx b/client/src/components/monitors/HeaderControls.tsx
index 90e1c4010..b0397e778 100644
--- a/client/src/components/monitors/HeaderControls.tsx
+++ b/client/src/components/monitors/HeaderControls.tsx
@@ -69,14 +69,14 @@ export const HeaderControls = ({
refetch();
}}
startIcon={
- monitor?.isActive ? (
+ monitor.status === "paused" ? (
) : (
)
}
>
- {monitor?.isActive ? t("pause") : t("resume")}
+ {monitor?.status === "paused" ? t("resume") : t("pause")}
}
diff --git a/client/src/pages/diagnostic/DiagnosticsQueueTab.tsx b/client/src/pages/diagnostic/DiagnosticsQueueTab.tsx
index 99ce2e305..bd10a5247 100644
--- a/client/src/pages/diagnostic/DiagnosticsQueueTab.tsx
+++ b/client/src/pages/diagnostic/DiagnosticsQueueTab.tsx
@@ -59,7 +59,7 @@ export const DiagnosticsQueueTab = () => {
id: "active",
content: t("diagnosticsPage.tableHeaderActive"),
render: (row) => {
- return row?.data?.isActive ? "true" : "false";
+ return row?.active === true ? "true" : "false";
},
},
diff --git a/client/src/pages/infrastructure/InfraMonitorsTable.tsx b/client/src/pages/infrastructure/InfraMonitorsTable.tsx
index 094f25ff9..64877f5b1 100644
--- a/client/src/pages/infrastructure/InfraMonitorsTable.tsx
+++ b/client/src/pages/infrastructure/InfraMonitorsTable.tsx
@@ -98,7 +98,7 @@ export const InfraMonitorsTable = ({
// },
{
id: 6,
- label: monitor.isActive ? "Pause" : "Resume",
+ label: monitor.status === "paused" ? "Resume" : "Pause",
action: async () => {
await patch(`/monitors/${monitor._id}/active`);
refetch();
@@ -129,7 +129,7 @@ export const InfraMonitorsTable = ({
id: "status",
content: t("status"),
render: (row) => {
- return ;
+ return ;
},
},
{
@@ -154,11 +154,11 @@ export const InfraMonitorsTable = ({
id: "disk",
content: t("disk"),
render: (row) => {
- const totalDiskUsage = row.latestChecks?.[0]?.system?.disk.reduce(
+ const totalDiskUsage = row.latestChecks?.[0]?.system?.disk?.reduce(
(acc, disk) => acc + disk.usage_percent,
0
);
- const diskCount = row.latestChecks?.[0]?.system?.disk.length || 1;
+ const diskCount = row.latestChecks?.[0]?.system?.disk?.length || 1;
const diskUsage = ((totalDiskUsage || 0) / diskCount) * 100;
return ;
},
diff --git a/client/src/pages/pagespeed/PageSpeedMonitorTable.tsx b/client/src/pages/pagespeed/PageSpeedMonitorTable.tsx
index 728435c77..bea7165b0 100644
--- a/client/src/pages/pagespeed/PageSpeedMonitorTable.tsx
+++ b/client/src/pages/pagespeed/PageSpeedMonitorTable.tsx
@@ -99,7 +99,7 @@ export const PageSpeedMonitorTable = ({
// },
{
id: 6,
- label: monitor.isActive ? "Pause" : "Resume",
+ label: monitor.status === "paused" ? "Resume" : "Pause",
action: async () => {
await patch(`/monitors/${monitor._id}/active`);
refetch();
@@ -130,7 +130,7 @@ export const PageSpeedMonitorTable = ({
id: "status",
content: t("status"),
render: (row) => {
- return ;
+ return ;
},
},
{
diff --git a/client/src/pages/uptime/MonitorTable.tsx b/client/src/pages/uptime/MonitorTable.tsx
index 1d5368ee2..b3d93140c 100644
--- a/client/src/pages/uptime/MonitorTable.tsx
+++ b/client/src/pages/uptime/MonitorTable.tsx
@@ -97,7 +97,7 @@ export const MonitorTable = ({
// },
{
id: 6,
- label: monitor.isActive ? "Pause" : "Resume",
+ label: monitor.status === "paused" ? "Resume" : "Pause",
action: async () => {
await patch(`/monitors/${monitor._id}/active`);
refetch();
@@ -128,7 +128,7 @@ export const MonitorTable = ({
id: "status",
content: t("status"),
render: (row) => {
- return ;
+ return ;
},
},
{
diff --git a/client/src/types/monitor.ts b/client/src/types/monitor.ts
index f3fb63f41..0287c5c6a 100644
--- a/client/src/types/monitor.ts
+++ b/client/src/types/monitor.ts
@@ -27,7 +27,6 @@ export interface IMonitor {
createdAt: string;
createdBy: string;
interval: number;
- isActive: boolean;
latestChecks: ICheck[];
n: number;
name: string;
diff --git a/client/src/utils/MonitorUtils.ts b/client/src/utils/MonitorUtils.ts
index 62d4283fe..1f64a75b7 100644
--- a/client/src/utils/MonitorUtils.ts
+++ b/client/src/utils/MonitorUtils.ts
@@ -6,6 +6,7 @@ export const getStatusPalette = (status: MonitorStatus): PaletteKey => {
const paletteMap: Record = {
up: "success",
down: "error",
+ paused: "warning",
initializing: "warning",
};
return paletteMap[status];