fix: Sentinel 清除占位卡片 + 动画延长至 1s
This commit is contained in:
@@ -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; });
|
||||
|
||||
Reference in New Issue
Block a user