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
+22
View File
@@ -240,5 +240,27 @@
"framework.command.execute"
],
"timestamp": 27252.872485748
},
"22047bb8": {
"plugin_name": "example_plugin",
"permissions": [
"plugin.example.read",
"plugin.example.write",
"plugin.example.execute",
"framework.event.subscribe",
"framework.command.execute"
],
"timestamp": 27544.255777304
},
"e88d2c96": {
"plugin_name": "sentinel",
"permissions": [
"plugin.sentinel.read",
"plugin.sentinel.write",
"plugin.network.access",
"framework.event.subscribe",
"framework.command.execute"
],
"timestamp": 27544.2709947
}
}
+1 -1
View File
@@ -101,7 +101,7 @@ commands:
permissions:
- framework.command.test
source: internal
last_updated: 27252.853477519
last_updated: 27544.226537616
plugin_commands:
example_plugin:
echo: *id001
+1 -1
View File
@@ -1,5 +1,5 @@
http_port: 4200
last_updated: 27252.870587988
last_updated: 27544.261331002
plugin_routes:
example_plugin:
- methods:
+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; });