debug: pollNodes加console.log追踪

This commit is contained in:
qinglong
2026-06-14 12:20:17 +08:00
parent 0a3269a0d7
commit 257f92f746
+7 -1
View File
@@ -371,9 +371,15 @@ function bar(v) { return v < 60 ? 'bar-green' : (v < 85 ? 'bar-yellow' : 'bar-re
function esc(s) { return String(s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/"/g,'&quot;'); }
function pollNodes() {
fetch("/sentinel/api/nodes").then(function(r){return r.json()}).then(function(d){
console.log("pollNodes: fetching...");
fetch("/sentinel/api/nodes").then(function(r){
console.log("pollNodes: status="+r.status);
return r.json();
}).then(function(d){
console.log("pollNodes: got "+ (d.nodes ? d.nodes.length : 0) +" nodes");
renderNodes(d.nodes || []);
}).catch(function(e){
console.error("pollNodes error:", e);
var grid = document.getElementById("sentinel-grid");
if (grid && _firstRender) {
grid.innerHTML = '<div class="card" style="text-align:center;padding:24px;color:var(--error)">连接失败 — 检查节点配置</div>';