diff --git a/web/src/portal/components/server/GpuMonitorSection.tsx b/web/src/portal/components/server/GpuMonitorSection.tsx index f202fa1..a4024cd 100644 --- a/web/src/portal/components/server/GpuMonitorSection.tsx +++ b/web/src/portal/components/server/GpuMonitorSection.tsx @@ -15,6 +15,23 @@ export const GpuMonitorSection = ({latestMetrics}: GpuMonitorSectionProps) => { // 如果没有 GPU 数据,不渲染组件 if (!latestMetrics?.gpu || latestMetrics.gpu.length === 0) { return null; + // # mock 测试 + // const mockGpu: GPUMetric = { + // agentId: "agent123", // 代理 ID + // fanSpeed: 3000, // 风扇转速(单位:rpm) + // id: 1, // GPU ID + // index: 0, // GPU 索引 + // memoryFree: 4096, // 可用内存(单位:MB) + // memoryTotal: 8192, // 总内存(单位:MB) + // memoryUsed: 4096, // 已用内存(单位:MB) + // name: "NVIDIA GeForce RTX 3070", // GPU 名称 + // performanceState: "P0", // 性能状态(P0-P15) + // powerUsage: 150, // 功率使用(单位:W) + // temperature: 70, // 温度(单位:°C) + // timestamp: Date.now(), // 当前时间戳 + // utilization: 85 // GPU 利用率(单位:%) + // }; + // latestMetrics.gpu = [mockGpu]; } return ( @@ -23,41 +40,48 @@ export const GpuMonitorSection = ({latestMetrics}: GpuMonitorSectionProps) => { {latestMetrics.gpu.map((gpu) => (
GPU {gpu.index}
-{gpu.name}
+GPU {gpu.index}
+{gpu.name}