From cf00fce50091541fc21a7b8737d2b8dd47906a70 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 9 May 2026 15:55:55 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E6=8E=A8=E7=90=86=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E5=8F=B0UI=E6=94=B9=E7=94=A8bricks=E5=A3=B0=E6=98=8E?= =?UTF-8?q?=E5=BC=8Fwidgets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 静态UI改用VBox/HBox/Title2/Text/Input/Button/Scroll原生控件 - Html widget仅保留JS动态渲染逻辑(步骤卡片/状态更新) - 符合bricks框架声明式UI规范 --- wwwroot/reasoning_console.ui | 160 ++++++++++++++++++++++++++++++++++- 1 file changed, 156 insertions(+), 4 deletions(-) diff --git a/wwwroot/reasoning_console.ui b/wwwroot/reasoning_console.ui index 170eff2..0096173 100644 --- a/wwwroot/reasoning_console.ui +++ b/wwwroot/reasoning_console.ui @@ -1,6 +1,158 @@ { - "widgettype": "HTML", + "widgettype": "VBox", "options": { - "html": "\n\n\n\n\n\n
\n
\n

AI 推理控制台

\n 未连接\n
\n
\n \n
\n \n \n
\n
\n
\n
\n 等待连接...\n
\n
\n
\n
\n
\n
\n
\n \n

输入请求后点击\"开始推理\"查看 AI 推理过程

\n
\n
\n
\n\n\n" - } -} \ No newline at end of file + "width": "100%", + "height": "100%", + "spacing": 12 + }, + "subwidgets": [ + { + "widgettype": "HBox", + "options": { + "width": "100%", + "padding": "16px 20px", + "spacing": 12 + }, + "subwidgets": [ + { + "widgettype": "Title2", + "options": { + "text": "AI 推理控制台", + "halign": "left" + } + }, + { + "widgettype": "Text", + "id": "ws_status", + "options": { + "text": "未连接", + "halign": "right" + } + } + ] + }, + { + "widgettype": "VBox", + "options": { + "width": "calc(100% - 40px)", + "margin": "0 20px", + "padding": "16px", + "spacing": 12 + }, + "subwidgets": [ + { + "widgettype": "Input", + "id": "reasoning_input", + "options": { + "text": "", + "placeholder": "输入你的请求,AI 将自动推理、规划并执行..." + } + }, + { + "widgettype": "HBox", + "options": { + "width": "100%", + "spacing": 10 + }, + "subwidgets": [ + { + "widgettype": "Button", + "id": "start_btn", + "options": { + "text": "开始推理", + "bgcolor": "#2196F3" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "script", + "script": "startReasoning()" + } + ] + }, + { + "widgettype": "Button", + "id": "clear_btn", + "options": { + "text": "清空日志", + "bgcolor": "#607D8B" + }, + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "script", + "script": "clearSteps()" + } + ] + } + ] + } + ] + }, + { + "widgettype": "VBox", + "id": "status_bar", + "options": { + "width": "calc(100% - 40px)", + "margin": "0 20px", + "padding": "12px 16px", + "spacing": 4 + }, + "subwidgets": [ + { + "widgettype": "Text", + "id": "status_text", + "options": { + "text": "等待连接...", + "halign": "left" + } + }, + { + "widgettype": "Text", + "id": "current_step", + "options": { + "text": "", + "halign": "left" + } + } + ] + }, + { + "widgettype": "Scroll", + "options": { + "width": "100%", + "height": "auto" + }, + "subwidgets": [ + { + "widgettype": "VBox", + "id": "steps_container", + "options": { + "width": "calc(100% - 40px)", + "margin": "0 20px", + "spacing": 8, + "padding": "8px 0" + }, + "subwidgets": [] + } + ] + }, + { + "widgettype": "Html", + "id": "ws_logic", + "options": { + "html": "" + } + }, + { + "widgettype": "WebSocket", + "id": "reasoning_ws", + "options": { + "ws_url": "{{entire_url('../reasoning_console.wss')}}", + "with_session": true + } + } + ] +}