admin update
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user