fix: Sentinel 加载 chart.js + MiniChart 未就绪回退网格
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
<script src="/SenSu/static/js/chart.js?v=0705"></script>
|
||||||
<div class="plugin-page-root" style="padding:16px">
|
<div class="plugin-page-root" style="padding:16px">
|
||||||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px">
|
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px">
|
||||||
<h2 style="margin:0">🛡️ Sentinel 集群监控</h2>
|
<h2 style="margin:0">🛡️ Sentinel 集群监控</h2>
|
||||||
@@ -246,7 +247,13 @@
|
|||||||
|
|
||||||
if (isRow) {
|
if (isRow) {
|
||||||
var charts = _chartInstances[id];
|
var charts = _chartInstances[id];
|
||||||
if (charts && charts[0]) {
|
if (!charts) {
|
||||||
|
// MiniChart 未加载, 回退到网格模式
|
||||||
|
_layoutMode = 'grid';
|
||||||
|
toggleLayout();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (charts[0]) {
|
||||||
charts[0].update(cpuVal);
|
charts[0].update(cpuVal);
|
||||||
charts[1].update(memVal);
|
charts[1].update(memVal);
|
||||||
charts[2].update(net.rx_bytes_sec||0);
|
charts[2].update(net.rx_bytes_sec||0);
|
||||||
|
|||||||
Reference in New Issue
Block a user