fix: Sentinel 清除占位卡片 + 动画延长至 1s

This commit is contained in:
qinglong
2026-06-13 18:17:26 +08:00
parent f3a6e5fbcd
commit 417213096f
4 changed files with 30 additions and 3 deletions
+6 -1
View File
@@ -87,7 +87,7 @@
function animateValue(el, oldVal, newVal, decimals, suffix) {
if (oldVal === newVal) { el.textContent = newVal.toFixed(decimals) + suffix; return; }
var start = performance.now();
var duration = 350;
var duration = 1000;
function step(ts) {
var progress = Math.min((ts - start) / duration, 1);
// ease-out
@@ -99,13 +99,18 @@
requestAnimationFrame(step);
}
var _firstRender = true;
function renderNodes(nodes) {
var grid = document.getElementById("sentinel-grid");
if (!nodes.length) {
grid.innerHTML = '<div class="card" style="text-align:center;padding:24px;color:var(--text-dim)">暂无节点 — 切换到节点管理添加</div>';
_cardCache = {};
_firstRender = true;
return;
}
// 首次渲染清除占位
if (_firstRender) { grid.innerHTML = ''; _firstRender = false; }
// 清理已删除的节点
var activeIds = {};
nodes.forEach(function(n){ activeIds[n.id||n.name] = true; });