fix: MiniChart 仅新卡片创建一次 (避免重复)

This commit is contained in:
qinglong
2026-06-14 07:56:41 +08:00
parent f8dd44011f
commit 719e8b5d73
+2 -2
View File
@@ -213,7 +213,8 @@
'<div class="node-time"></div>'; '<div class="node-time"></div>';
} }
grid.appendChild(card); grid.appendChild(card);
if (isRow && typeof MiniChart !== 'undefined') { _cardCache[id] = card;
if (isRow && typeof MiniChart !== 'undefined' && !_chartInstances[id]) {
try { try {
_chartInstances[id] = [ _chartInstances[id] = [
new MiniChart(id+'-cpu', '#7aa2f7'), new MiniChart(id+'-cpu', '#7aa2f7'),
@@ -222,7 +223,6 @@
]; ];
} catch(e) {} } catch(e) {}
} }
_cardCache[id] = card;
} }
// 更新通用信息 // 更新通用信息