yumoqing 09ec855576 fix: correct Button控件属性和样式规范
- 将Button控件的'text'属性改为'label'(符合bricks-framework规范)
- 移除所有嵌套的'style'对象,将样式属性直接放在options顶层
- 确保所有UI文件符合bricks-framework最佳实践
2026-04-22 11:43:08 +08:00

64 lines
1.7 KiB
XML

{
"widgettype": "PopupWindow",
"options": {
"title": "Hermes Chat",
"width": "800px",
"height": "600px",
"resizable": true,
"draggable": true
},
"subwidgets": [
{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%"
},
"subwidgets": [
{
"widgettype": "LLMOut",
"options": {
"data_url": "/hermes-web-cli/sessions/{session_id}/messages",
"height": "400px"
}
},
{
"widgettype": "HBox",
"options": {
"width": "100%"
},
"subwidgets": [
{
"widgettype": "Input",
"options": {
"placeholder": "输入消息...",
"width": "100%"
}
},
{
"widgettype": "Filler",
"options": {
"width": "10px"
}
},
{
"widgettype": "Button",
"options": {
"width": "80px",
"label": "发送"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"script": "const input = bricks.findWidget('input'); const message = input.getValue(); if (message) { fetch('/hermes-web-cli/sessions/{session_id}/messages', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: message }) }).then(r => r.json()).then(data => { input.setValue(''); }); }"
}
]
}
]
}
]
}
]
}