diff --git a/src/app/monitoring/page.tsx b/src/app/monitoring/page.tsx index 13f1e69..f290113 100644 --- a/src/app/monitoring/page.tsx +++ b/src/app/monitoring/page.tsx @@ -6,7 +6,6 @@ import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { type ChartConfig } from "@/components/ui/chart"; import GradientAreaChart from "@/components/GradientAreaChart"; import { getMetrics } from "@/lib/dockship/metrics"; -import { useEffect, useState } from "react"; import { useIsMobile } from "@/hooks/use-mobile"; import RadialChart from "@/components/RadialChart"; import { getLiveNodes, getNodes } from "@/lib/dockship/node"; @@ -70,6 +69,12 @@ export default function MonitoringPage() { [] ); + const containerCPU = containerStats.reduce((acc, val) => acc + val.cpu, 0); + const containerMemory = containerStats.reduce( + (acc, val) => acc + val.memory, + 0 + ); + return ( {/* Summary Stats */} {isMobile ? ( -
- - +
+ + CPU - - + + RAM + + + con CPU + + + + + con RAM + +
) : (
@@ -97,7 +112,7 @@ export default function MonitoringPage() { CPU usage
- {liveData?.cpuUsage?.toFixed(0) || 0}% + {liveData?.cpuUsage?.toFixed(1) || 0}%
@@ -108,7 +123,7 @@ export default function MonitoringPage() { Memory usage
- {liveData?.ramUsage?.toFixed(0) || 0}% + {liveData?.ramUsage?.toFixed(1) || 0}%
@@ -116,21 +131,19 @@ export default function MonitoringPage() {
- Network In + Container CPU usage
-
38 MB/s
-
↑ 12% from avg
+
{containerCPU.toFixed(1)}%
+
- Network Out -
-
28 MB/s
-
- ↓ 5% from avg + Container memory usage
+
{containerMemory.toFixed(1)}%
+