- Change service_id field uitype from 'select' to 'code' (bricks has no select type)
- Create hermes_services/list/index.dspy endpoint to provide service list data for code component
- Use Form's built-in submit/cancel buttons instead of manual Button widgets
- Add sessions.json CRUD definition for session management
- Ensure proper data format for code component: {"value": "id", "text": "name"}
52 lines
1.3 KiB
XML
52 lines
1.3 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": "code",
|
|
"required": true,
|
|
"data_url": "/hermes-web-cli/hermes_services/list/"
|
|
},
|
|
{
|
|
"name": "initial_message",
|
|
"label": "Initial Message",
|
|
"uitype": "textarea",
|
|
"required": true,
|
|
"placeholder": "Enter your initial message to start the conversation..."
|
|
}
|
|
],
|
|
"submit_url": "/hermes-web-cli/sessions/",
|
|
"method": "POST"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "submited",
|
|
"actiontype": "script",
|
|
"script": "const data = event.params; if (data && data.session_id) { bricks.app.load_widget('{{entire_url(\"session_detail.ui\")}}?session_id=' + data.session_id, 'main-content', 'replace'); }"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |