From 8719bc499ef3b80201eac88e82dc829b67e21a02 Mon Sep 17 00:00:00 2001 From: "agent.develop" Date: Sun, 30 Aug 2026 22:14:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=BF=90=E8=A1=8C=E6=97=B6=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=85=A5=E5=8F=A3=E6=94=B9=E7=9C=9F=E5=AE=9E=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2status=5Fpage.ui(fetch=E6=B8=B2=E6=9F=93,=E5=8E=9F?= =?UTF-8?q?=E7=9B=B4=E6=8E=A5GET=20dspy)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/index.ui | 2 +- wwwroot/status_page.ui | 51 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 wwwroot/status_page.ui diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 4c003fa..46e7938 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -85,7 +85,7 @@ "actiontype": "urlwidget", "target": "app.runtime_content", "options": { - "url": "{{entire_url('/scense_runtime/api/runtime_status.dspy?runtime_id=local')}}" + "url": "{{entire_url('/scense_runtime/status_page.ui')}}" }, "mode": "replace" } diff --git a/wwwroot/status_page.ui b/wwwroot/status_page.ui new file mode 100644 index 0000000..cfe07a1 --- /dev/null +++ b/wwwroot/status_page.ui @@ -0,0 +1,51 @@ +{ + "widgettype": "VBox", + "options": { + "width": "100%", + "height": "100%", + "padding": "20px" + }, + "binds": [ + { + "wid": "self", + "event": "active", + "actiontype": "script", + "target": "self", + "script": "fetch('/scense_runtime/api/runtime_status.dspy?runtime_id=local').then(function(r){return r.json()}).then(function(d){var t=bricks.getWidgetById('rt_status',bricks.app);if(!t)return;var lines=['运行时: '+(d.runtime_id||'local'),'运行状态: '+(d.running?'运行中':'未运行')+(d.paused?'(已暂停)':''),'模式: '+(d.mode||'independent'),'实体数: '+(d.entities||0),'事件队列: '+(d.events||0),'错误数: '+(d.errors||0),'更新时间: '+(d.updated_at||'-')];t.set_text(lines.join('\\n'))}).catch(function(e){var t=bricks.getWidgetById('rt_status',bricks.app);if(t)t.set_text('查询失败: '+e)})" + } + ], + "subwidgets": [ + { + "widgettype": "Text", + "options": { + "label": "📊 运行时状态", + "fontSize": "20px" + } + }, + { + "widgettype": "Text", + "id": "rt_status", + "options": { + "text": "加载中…", + "whiteSpace": "pre-line", + "margin": "12px 0" + } + }, + { + "widgettype": "Button", + "options": { + "label": "🔄 刷新", + "css": "primary" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "script", + "target": "self", + "script": "fetch('/scense_runtime/api/runtime_status.dspy?runtime_id=local').then(function(r){return r.json()}).then(function(d){var t=bricks.getWidgetById('rt_status',bricks.app);if(!t)return;var lines=['运行时: '+(d.runtime_id||'local'),'运行状态: '+(d.running?'运行中':'未运行')+(d.paused?'(已暂停)':''),'模式: '+(d.mode||'independent'),'实体数: '+(d.entities||0),'事件队列: '+(d.events||0),'错误数: '+(d.errors||0),'更新时间: '+(d.updated_at||'-')];t.set_text(lines.join('\\n'))}).catch(function(e){var t=bricks.getWidgetById('rt_status',bricks.app);if(t)t.set_text('查询失败: '+e)})" + } + ] + } + ] +} \ No newline at end of file