From a2bd6486a01afd12383bfae3af0eb467598af345 Mon Sep 17 00:00:00 2001 From: qinglong Date: Sat, 13 Jun 2026 18:29:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=A8=E7=94=BB=E6=94=B9=E7=94=A8=20s?= =?UTF-8?q?etInterval=20(=E5=85=BC=E5=AE=B9=E5=8A=A8=E6=80=81=20script=20?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD)=20+=20try-catch=20=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/permissions/pending_requests.json | 22 +++++++++++++++++++ config/plugins/commands.yaml | 2 +- config/services/network_routes.yaml | 2 +- static/web_panel/pages/dashboard.js | 28 +++++++++++++----------- 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/config/permissions/pending_requests.json b/config/permissions/pending_requests.json index 2a00134..850be38 100644 --- a/config/permissions/pending_requests.json +++ b/config/permissions/pending_requests.json @@ -328,5 +328,27 @@ "framework.command.execute" ], "timestamp": 28040.668302635 + }, + "2a0ced83": { + "plugin_name": "example_plugin", + "permissions": [ + "plugin.example.read", + "plugin.example.write", + "plugin.example.execute", + "framework.event.subscribe", + "framework.command.execute" + ], + "timestamp": 28375.085750685 + }, + "8a812834": { + "plugin_name": "sentinel", + "permissions": [ + "plugin.sentinel.read", + "plugin.sentinel.write", + "plugin.network.access", + "framework.event.subscribe", + "framework.command.execute" + ], + "timestamp": 28375.089465424 } } \ No newline at end of file diff --git a/config/plugins/commands.yaml b/config/plugins/commands.yaml index d389cb8..bfd4ed4 100644 --- a/config/plugins/commands.yaml +++ b/config/plugins/commands.yaml @@ -101,7 +101,7 @@ commands: permissions: - framework.command.test source: internal -last_updated: 28040.621524771 +last_updated: 28375.06993407 plugin_commands: example_plugin: echo: *id001 diff --git a/config/services/network_routes.yaml b/config/services/network_routes.yaml index 8f72d2e..9822c58 100644 --- a/config/services/network_routes.yaml +++ b/config/services/network_routes.yaml @@ -1,5 +1,5 @@ http_port: 4200 -last_updated: 28040.661568417 +last_updated: 28375.086802768 plugin_routes: example_plugin: - methods: diff --git a/static/web_panel/pages/dashboard.js b/static/web_panel/pages/dashboard.js index d53b452..8be95fa 100644 --- a/static/web_panel/pages/dashboard.js +++ b/static/web_panel/pages/dashboard.js @@ -5,19 +5,21 @@ window.DashboardModule = { charts: {}, _animateNumber: function(el, newVal, decimals, suffix) { - var self = this; - var oldVal = parseFloat(el.getAttribute('data-val') || newVal); - if (Math.abs(oldVal - newVal) < 0.05) { el.textContent = newVal.toFixed(decimals) + suffix; return; } - el.setAttribute('data-val', newVal); - var start = performance.now(); - var duration = 900; - function step(ts) { - var p = Math.min((ts - start) / duration, 1); - var eased = 1 - Math.pow(1 - p, 3); - el.textContent = (oldVal + (newVal - oldVal) * eased).toFixed(decimals) + suffix; - if (p < 1) requestAnimationFrame(step); - } - requestAnimationFrame(step); + try { + var oldVal = parseFloat(el.getAttribute('data-val')); + if (isNaN(oldVal)) oldVal = newVal; + if (Math.abs(oldVal - newVal) < 0.05) { el.textContent = newVal.toFixed(decimals) + suffix; el.setAttribute('data-val', newVal); return; } + el.setAttribute('data-val', newVal); + var steps = 20, i = 0; + var stepMs = 50; // 20 steps × 50ms = 1000ms + var timer = setInterval(function(){ + i++; + var p = Math.min(i / steps, 1); + var eased = 1 - Math.pow(1 - p, 3); + el.textContent = (oldVal + (newVal - oldVal) * eased).toFixed(decimals) + suffix; + if (i >= steps) clearInterval(timer); + }, stepMs); + } catch(e) { el.textContent = newVal.toFixed(decimals) + suffix; } }, init: function() {