hermes-web-cli/wwwroot/sessions.ui
yumoqing 5d4e70da8e feat: complete missing UI files and API endpoints for hermes-web-cli
- 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
2026-04-22 11:22:44 +08:00

89 lines
2.3 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "Active Sessions",
"fontSize": "24px",
"fontWeight": "bold",
"marginBottom": "20px",
"color": "#F8FAFC"
}
},
{
"widgettype": "DataViewer",
"options": {
"data_url": "/hermes-web-cli/sessions/active",
"page_rows": 10,
"row_options": {
"fields": [
{
"name": "session_id",
"label": "Session ID",
"uitype": "str"
},
{
"name": "session_name",
"label": "Session Name",
"uitype": "str"
},
{
"name": "service_name",
"label": "Service",
"uitype": "str"
},
{
"name": "message_count",
"label": "Messages",
"uitype": "int"
},
{
"name": "created_at",
"label": "Created",
"uitype": "date"
},
{
"name": "status",
"label": "Status",
"uitype": "str"
}
]
},
"toolbar": {
"tools": [
{
"name": "open_session",
"text": "Open",
"icon": "fa fa-folder-open"
},
{
"name": "delete_session",
"text": "Delete",
"icon": "fa fa-trash"
}
]
}
},
"binds": [
{
"wid": "self",
"event": "open_session",
"actiontype": "script",
"script": "const selectedRow = event.params; if (selectedRow) { const url = `{{entire_url('session_detail.ui')}}?session_id=${selectedRow.session_id}`; bricks.app.load_widget(url, 'main-content', 'replace'); }"
},
{
"wid": "self",
"event": "delete_session",
"actiontype": "script",
"script": "const selectedRow = event.params; if (selectedRow) { fetch(`/hermes-web-cli/sessions/${selectedRow.session_id}`, { method: 'DELETE' }).then(() => { this.refresh(); }); }"
}
]
}
]
}