- Add comprehensive examples for Popup.ui and PopupWindow.ui components - Update chat.ui to use PopupWindow for better desktop-like experience - PopupWindow provides draggable, resizable application windows with title bar - Popup provides modal/non-modal popup layers with auto-dismiss support - Both components support proper event handling and lifecycle management - Examples demonstrate real-world usage patterns for hermes-web-cli module
59 lines
1.5 KiB
XML
59 lines
1.5 KiB
XML
{
|
|
"widgettype": "PopupWindow",
|
|
"options": {
|
|
"title": "{{params_kw.get('service_name')}} - {{params_kw.get('session_name')}}",
|
|
"width": "800px",
|
|
"height": "600px",
|
|
"auto_open": true,
|
|
"movable": true,
|
|
"resizable": true,
|
|
"modal": false
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"width": "100%",
|
|
"height": "100%"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Filler",
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "LLMOut",
|
|
"options": {
|
|
"data_url": "/api/hermes-web-cli/sessions/{{params_kw.get('session_id')}}/messages",
|
|
"auto_scroll": true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {
|
|
"height": "80px"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Input",
|
|
"options": {
|
|
"placeholder": "输入您的消息...",
|
|
"width": "100%",
|
|
"height": "60px"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "keydown",
|
|
"actiontype": "script",
|
|
"script": "if (event.key === 'Enter' && !event.shiftKey) { event.preventDefault(); /* 发送消息逻辑 */ }"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |