- Refactor index.ui to use Menu widget for navigation following proper CRUD pattern - Create session_messages.json CRUD definition for session messages management - Update all UI files to reference correct CRUD auto-generated endpoints: * index.ui: /hermes-web-cli/hermes_service_sessions/ * sessions.ui: /hermes-web-cli/active_sessions/ * services.ui: /hermes-web-cli/hermes_services/ * settings.ui, new_session.ui, edit_service.ui: updated service references * session_detail.ui, chat.ui, session_chat.ui: updated to use session_messages CRUD - Remove manual .dspy endpoint references in favor of standardized CRUD mechanism - Follow module-development-spec and CRUD usage best practices
64 lines
1.7 KiB
XML
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/session_messages/?session_id={session_id}",
|
|
"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/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(''); }); }"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |