diff --git a/web/src/app/(main)/dashboard/page.tsx b/web/src/app/(main)/dashboard/page.tsx index 241e75a..37a20ce 100644 --- a/web/src/app/(main)/dashboard/page.tsx +++ b/web/src/app/(main)/dashboard/page.tsx @@ -107,13 +107,16 @@ function statusBg(code: number): string { function SystemResourceStatus({ metrics }: { metrics: SystemMetrics | null }) { if (!metrics) return null; + if (!metrics.supported) { + return
资源状态:暂不支持
; + } const items = [ [CpuIcon, "CPU", metrics.cpu.percent], [MemoryStickIcon, "内存", metrics.memory.percent], [HardDriveIcon, "磁盘", metrics.data_disk.percent], ] as const; return ( -
+
容器资源 {items.map(([Icon, label, value]) => (
@@ -121,10 +124,12 @@ function SystemResourceStatus({ metrics }: { metrics: SystemMetrics | null }) { {value.toFixed(1)}%
- +
))} - {!metrics.supported && 暂不支持}
); }