- Html widget's innerHTML doesn't execute <script> tags, causing 'startReasoning is not defined' error - Extract all JS (reasoningWS, startReasoning, clearSteps) into reasoning_console.js which is auto-loaded by Sage's header.tmpl - Switch Button binds from actiontype='script' to actiontype='registerfunction' with rfname - Fix widgettype 'Input' -> 'KeyinText' (Input is not registered) - Fix widgettype 'Scroll' -> 'VBox' with CSS overflow (Scroll not registered) - Remove duplicate WebSocket widget (JS handles WS connection directly) - Clean up failed fix script attempts
151 lines
3.4 KiB
XML
151 lines
3.4 KiB
XML
{
|
||
"widgettype": "VBox",
|
||
"options": {
|
||
"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": "KeyinText",
|
||
"id": "reasoning_input",
|
||
"options": {
|
||
"text": "",
|
||
"placeholder": "输入你的请求,AI 将自动推理、规划并执行..."
|
||
}
|
||
},
|
||
{
|
||
"widgettype": "HBox",
|
||
"options": {
|
||
"width": "100%",
|
||
"spacing": 10
|
||
},
|
||
"subwidgets": [
|
||
{
|
||
"widgettype": "Button",
|
||
"id": "start_btn",
|
||
"options": {
|
||
"bgcolor": "#2196F3",
|
||
"label": "开始推理"
|
||
},
|
||
"binds": [
|
||
{
|
||
"wid": "self",
|
||
"event": "click",
|
||
"actiontype": "registerfunction",
|
||
"rfname": "startReasoning"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
"widgettype": "Button",
|
||
"id": "clear_btn",
|
||
"options": {
|
||
"bgcolor": "#607D8B",
|
||
"label": "清空日志"
|
||
},
|
||
"binds": [
|
||
{
|
||
"wid": "self",
|
||
"event": "click",
|
||
"actiontype": "registerfunction",
|
||
"rfname": "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": "VBox",
|
||
"options": {
|
||
"width": "100%",
|
||
"height": "auto",
|
||
"style": "overflow-y: auto; max-height: 60vh;"
|
||
},
|
||
"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": "<div id=\"reasoning_console_js_loaded\" style=\"display:none;\"></div>"
|
||
}
|
||
}
|
||
]
|
||
} |