hermes-web-cli/wwwroot/services.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.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": {
"icon": "fa fa-plus",
"backgroundColor": "#22C55E",
"color": "#FFFFFF",
"border": "none",
"borderRadius": "6px",
"padding": "10px 20px",
"marginBottom": "20px",
"label": "Add New Service"
},
"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/hermes_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/hermes_services/?id=${selectedRow.id}`, { method: 'DELETE' }).then(() => { this.refresh(); }); }"
}
]
}
]
}