- Added all missing .ui files referenced in index.ui:
* new_session.ui
* sessions.ui
* services.ui
* settings.ui
* session_detail.ui
* add_service.ui
* edit_service.ui
- Created corresponding .dspy API endpoints with proper directory structure:
* /hermes-web-cli/services → services/index.dspy
* /hermes-web-cli/services/list → services/list/index.dspy
* /hermes-web-cli/services/{id} → services/id/index.dspy
* /hermes-web-cli/services/test?id={id} → services/test/index.dspy
* /hermes-web-cli/sessions (POST) → sessions/index.dspy
* /hermes-web-cli/sessions/messages?session_id={id} → sessions/messages/index.dspy
* /hermes-web-cli/settings → settings/index.dspy
* /hermes-web-cli/settings/reset → settings/reset/index.dspy
- Fixed UI styling to comply with bricks-framework (removed nested style objects)
- Updated URL references to use query parameters instead of path parameters for dynamic routes
- All files follow production-ready module development specifications
102 lines
2.7 KiB
XML
102 lines
2.7 KiB
XML
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"width": "100%",
|
|
"height": "100%",
|
|
"padding": "20px"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"text": "Add New Service",
|
|
"fontSize": "24px",
|
|
"fontWeight": "bold",
|
|
"marginBottom": "20px",
|
|
"color": "#F8FAFC"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Form",
|
|
"id": "add-service-form",
|
|
"options": {
|
|
"fields": [
|
|
{
|
|
"name": "name",
|
|
"label": "Service Name",
|
|
"uitype": "str",
|
|
"required": true,
|
|
"placeholder": "Enter service name"
|
|
},
|
|
{
|
|
"name": "url",
|
|
"label": "Service URL",
|
|
"uitype": "str",
|
|
"required": true,
|
|
"placeholder": "http://localhost:8080"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"label": "Description",
|
|
"uitype": "str",
|
|
"placeholder": "Optional description"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "HBox",
|
|
"options": {
|
|
"width": "100%",
|
|
"height": "auto",
|
|
"marginTop": "20px",
|
|
"gap": "10px"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {
|
|
"text": "Add Service",
|
|
"icon": "fa fa-plus",
|
|
"backgroundColor": "#22C55E",
|
|
"color": "#FFFFFF",
|
|
"border": "none",
|
|
"borderRadius": "6px",
|
|
"padding": "10px 20px"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "click",
|
|
"actiontype": "script",
|
|
"script": "const formData = bricks.app.get_widget('add-service-form').get_data(); if (formData.name && formData.url) { fetch('/hermes-web-cli/services', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(formData) }).then(response => response.json()).then(data => { bricks.app.load_widget('{{entire_url(\"services.ui\")}}', 'main-content', 'replace'); }); }"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {
|
|
"text": "Cancel",
|
|
"backgroundColor": "#64748B",
|
|
"color": "#FFFFFF",
|
|
"border": "none",
|
|
"borderRadius": "6px",
|
|
"padding": "10px 20px"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "click",
|
|
"actiontype": "urlwidget",
|
|
"target": "main-content",
|
|
"options": {
|
|
"url": "{{entire_url('services.ui')}}"
|
|
},
|
|
"mode": "replace"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |