From 4f6d7d9035cbe5954094b02ee49049b4c82e0abd Mon Sep 17 00:00:00 2001 From: quant Date: Wed, 18 Feb 2026 01:27:21 +0800 Subject: [PATCH] admin update --- static/admin.html | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/static/admin.html b/static/admin.html index df054ee..10b1719 100644 --- a/static/admin.html +++ b/static/admin.html @@ -994,12 +994,12 @@ const startGpuMonitoring = () => { if (gpuInterval) clearInterval(gpuInterval); - // Use setTimeout to ensure DOM is ready after v-if switch + // Use setTimeout to ensure DOM is ready after v-if switch (wait for slide-up transition ~700ms) setTimeout(() => { initGpuCharts(); fetchGpuStatus(); // Initial fetch gpuInterval = setInterval(fetchGpuStatus, 2000); // Every 2s - }, 300); + }, 800); }; const stopGpuMonitoring = () => { @@ -1007,6 +1007,9 @@ clearInterval(gpuInterval); gpuInterval = null; } + // Dispose charts to free memory and avoid resize issues on re-init + if (gpuUtilChartInst) { gpuUtilChartInst.dispose(); gpuUtilChartInst = null; } + if (gpuTempChartInst) { gpuTempChartInst.dispose(); gpuTempChartInst = null; } }; const initGpuCharts = () => { @@ -1051,11 +1054,20 @@ ] }); + // Explicitly resize to ensure correct rendering + gpuUtilChartInst.resize(); + gpuTempChartInst.resize(); + // Render initial data if available updateGpuCharts(); }; const updateGpuCharts = () => { + // Lazy init check + if ((!gpuUtilChartInst || !gpuTempChartInst) && gpuUtilChartRef.value && gpuTempChartRef.value) { + initGpuCharts(); + } + if (!gpuUtilChartInst || !gpuTempChartInst) return; const times = gpuHistory.value.map(h => h.time);