66 lines
1.8 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/session_messages/?session_id={session_id}",
"height": "400px"
}
},
{
"widgettype": "HBox",
"options": {
"width": "100%"
},
"subwidgets": [
{
"widgettype": "UiStr",
"id": "chat-input",
"options": {
"name": "chat-input",
"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/session_messages/?session_id={session_id}', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ message: message }) }).then(r => r.json()).then(data => { input.setValue(''); }); }"
}
]
}
]
}
]
}
]
}