hermes-web-cli/wwwroot/session_chat.ui
yumoqing 930ed6dea7 feat(hermes-web-cli): update UI files to use CRUD auto-generated endpoints
- 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
2026-04-22 11:55:16 +08:00

125 lines
3.1 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "auto",
"marginBottom": "24px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "Session Chat",
"fontSize": "24px",
"fontWeight": "bold",
"color": "#F8FAFC"
}
},
{
"widgettype": "Filler"
},
{
"widgettype": "Button",
"options": {
"icon": "fa fa-arrow-left",
"label": "Back to Sessions",
"backgroundColor": "#1E293B",
"color": "#F8FAFC",
"border": "1px solid #334155",
"borderRadius": "6px",
"padding": "8px 16px"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "main-content",
"options": {
"url": "{{entire_url('sessions.ui')}}"
},
"mode": "replace"
}
]
}
]
},
{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "calc(100% - 100px)",
"backgroundColor": "#1E293B",
"borderRadius": "8px",
"padding": "20px",
"border": "1px solid #334155",
"overflow": "auto"
},
"subwidgets": [
{
"widgettype": "DataViewer",
"id": "chat-messages",
"options": {
"data_url": "/hermes-web-cli/session_messages/?session_id={{params_kw.get('session_id')}}",
"page_rows": 50,
"row_options": {
"fields": [
{
"name": "role",
"label": "Role",
"uitype": "str"
},
{
"name": "content",
"label": "Message",
"uitype": "str"
},
{
"name": "timestamp",
"label": "Time",
"uitype": "date"
}
]
},
"toolbar": {
"tools": []
}
}
}
]
},
{
"widgettype": "Form",
"options": {
"fields": [
{
"name": "message",
"label": "Your Message",
"uitype": "text",
"required": true,
"placeholder": "Type your message here..."
}
],
"notoolbar": true,
"submit_url": "/hermes-web-cli/session_messages/?session_id={{params_kw.get('session_id')}}",
"method": "POST"
},
"binds": [
{
"wid": "self",
"event": "submited",
"actiontype": "script",
"script": "bricks.show_resp_message_or_error(event.params).then(() => { document.querySelector('#chat-messages').refresh(); });"
}
]
}
]
}