hermes-web-cli/wwwroot/new_session.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

96 lines
2.7 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "Create New Session",
"fontSize": "24px",
"fontWeight": "bold",
"marginBottom": "20px",
"color": "#F8FAFC"
}
},
{
"widgettype": "Form",
"id": "new-session-form",
"options": {
"fields": [
{
"name": "service_id",
"label": "Service",
"uitype": "select",
"required": true,
"data_url": "/hermes-web-cli/hermes_services/"
},
{
"name": "initial_message",
"label": "Initial Message",
"uitype": "textarea",
"required": true,
"placeholder": "Enter your initial message to start the conversation..."
}
]
}
},
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "auto",
"marginTop": "20px",
"gap": "10px"
},
"subwidgets": [
{
"widgettype": "Button",
"options": {
"icon": "fa fa-plus",
"backgroundColor": "#22C55E",
"color": "#FFFFFF",
"border": "none",
"borderRadius": "6px",
"padding": "10px 20px",
"label": "Create Session"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"script": "const formData = bricks.app.get_widget('new-session-form').get_data(); if (formData.service_id && formData.initial_message) { fetch('/hermes-web-cli/sessions', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(formData) }).then(response => response.json()).then(data => { bricks.app.load_widget('{{entire_url(\"session_detail.ui\")}}?session_id=' + data.session_id, 'main-content', 'replace'); }); }"
}
]
},
{
"widgettype": "Button",
"options": {
"backgroundColor": "#64748B",
"color": "#FFFFFF",
"border": "none",
"borderRadius": "6px",
"padding": "10px 20px",
"label": "Cancel"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "urlwidget",
"target": "main-content",
"options": {
"url": "{{entire_url('index.ui')}}"
},
"mode": "replace"
}
]
}
]
}
]
}