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" "framework.command.execute"
], ],
"timestamp": 27252.872485748 "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: permissions:
- framework.command.test - framework.command.test
source: internal source: internal
last_updated: 27252.853477519 last_updated: 27544.226537616
plugin_commands: plugin_commands:
example_plugin: example_plugin:
echo: *id001 echo: *id001
+1 -1
View File
@@ -1,5 +1,5 @@
http_port: 4200 http_port: 4200
last_updated: 27252.870587988 last_updated: 27544.261331002
plugin_routes: plugin_routes:
example_plugin: example_plugin:
- methods: - methods:
+6 -1
View File
@@ -87,7 +87,7 @@
function animateValue(el, oldVal, newVal, decimals, suffix) { function animateValue(el, oldVal, newVal, decimals, suffix) {
if (oldVal === newVal) { el.textContent = newVal.toFixed(decimals) + suffix; return; } if (oldVal === newVal) { el.textContent = newVal.toFixed(decimals) + suffix; return; }
var start = performance.now(); var start = performance.now();
var duration = 350; var duration = 1000;
function step(ts) { function step(ts) {
var progress = Math.min((ts - start) / duration, 1); var progress = Math.min((ts - start) / duration, 1);
// ease-out // ease-out
@@ -99,13 +99,18 @@
requestAnimationFrame(step); requestAnimationFrame(step);
} }
var _firstRender = true;
function renderNodes(nodes) { function renderNodes(nodes) {
var grid = document.getElementById("sentinel-grid"); var grid = document.getElementById("sentinel-grid");
if (!nodes.length) { if (!nodes.length) {
grid.innerHTML = '<div class="card" style="text-align:center;padding:24px;color:var(--text-dim)">暂无节点 — 切换到节点管理添加</div>'; grid.innerHTML = '<div class="card" style="text-align:center;padding:24px;color:var(--text-dim)">暂无节点 — 切换到节点管理添加</div>';
_cardCache = {}; _cardCache = {};
_firstRender = true;
return; return;
} }
// 首次渲染清除占位
if (_firstRender) { grid.innerHTML = ''; _firstRender = false; }
// 清理已删除的节点 // 清理已删除的节点
var activeIds = {}; var activeIds = {};
nodes.forEach(function(n){ activeIds[n.id||n.name] = true; }); nodes.forEach(function(n){ activeIds[n.id||n.name] = true; });