- 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
125 lines
3.4 KiB
XML
125 lines
3.4 KiB
XML
{
|
|
"widgettype": "VBox",
|
|
"options": {
|
|
"width": "100%",
|
|
"height": "100%",
|
|
"padding": "20px"
|
|
},
|
|
"subwidgets": [
|
|
{
|
|
"widgettype": "Text",
|
|
"options": {
|
|
"text": "Hermes Services",
|
|
"fontSize": "24px",
|
|
"fontWeight": "bold",
|
|
"marginBottom": "20px",
|
|
"color": "#F8FAFC"
|
|
}
|
|
},
|
|
{
|
|
"widgettype": "Button",
|
|
"options": {
|
|
"text": "Add New Service",
|
|
"icon": "fa fa-plus",
|
|
"backgroundColor": "#22C55E",
|
|
"color": "#FFFFFF",
|
|
"border": "none",
|
|
"borderRadius": "6px",
|
|
"padding": "10px 20px",
|
|
"marginBottom": "20px"
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "click",
|
|
"actiontype": "urlwidget",
|
|
"target": "main-content",
|
|
"options": {
|
|
"url": "{{entire_url('add_service.ui')}}"
|
|
},
|
|
"mode": "replace"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"widgettype": "DataViewer",
|
|
"options": {
|
|
"data_url": "/hermes-web-cli/services",
|
|
"page_rows": 10,
|
|
"row_options": {
|
|
"fields": [
|
|
{
|
|
"name": "id",
|
|
"label": "Service ID",
|
|
"uitype": "str"
|
|
},
|
|
{
|
|
"name": "name",
|
|
"label": "Name",
|
|
"uitype": "str"
|
|
},
|
|
{
|
|
"name": "service_url",
|
|
"label": "URL",
|
|
"uitype": "str"
|
|
},
|
|
{
|
|
"name": "description",
|
|
"label": "Description",
|
|
"uitype": "str"
|
|
},
|
|
{
|
|
"name": "status",
|
|
"label": "Status",
|
|
"uitype": "str"
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"label": "Created",
|
|
"uitype": "date"
|
|
}
|
|
]
|
|
},
|
|
"toolbar": {
|
|
"tools": [
|
|
{
|
|
"name": "test_connection",
|
|
"text": "Test Connection",
|
|
"icon": "fa fa-plug"
|
|
},
|
|
{
|
|
"name": "edit_service",
|
|
"text": "Edit",
|
|
"icon": "fa fa-edit"
|
|
},
|
|
{
|
|
"name": "delete_service",
|
|
"text": "Delete",
|
|
"icon": "fa fa-trash"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"binds": [
|
|
{
|
|
"wid": "self",
|
|
"event": "test_connection",
|
|
"actiontype": "script",
|
|
"script": "const selectedRow = event.params; if (selectedRow) { fetch(`/hermes-web-cli/services/test?id=${selectedRow.id}`).then(response => response.json()).then(data => { alert(`Connection test: ${data.status_message}`); }); }"
|
|
},
|
|
{
|
|
"wid": "self",
|
|
"event": "edit_service",
|
|
"actiontype": "script",
|
|
"script": "const selectedRow = event.params; if (selectedRow) { const url = `{{entire_url('edit_service.ui')}}?service_id=${selectedRow.id}`; bricks.app.load_widget(url, 'main-content', 'replace'); }"
|
|
},
|
|
{
|
|
"wid": "self",
|
|
"event": "delete_service",
|
|
"actiontype": "script",
|
|
"script": "const selectedRow = event.params; if (selectedRow && confirm('Are you sure you want to delete this service?')) { fetch(`/hermes-web-cli/services/${selectedRow.id}`, { method: 'DELETE' }).then(() => { this.refresh(); }); }"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
} |