hermes-web-cli/wwwroot/settings.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

102 lines
2.8 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "Settings",
"fontSize": "24px",
"fontWeight": "bold",
"marginBottom": "20px",
"color": "#F8FAFC"
}
},
{
"widgettype": "Form",
"id": "settings-form",
"options": {
"fields": [
{
"name": "default_service",
"label": "Default Service",
"uitype": "select",
"data_url": "/hermes-web-cli/services/list"
},
{
"name": "auto_save_sessions",
"label": "Auto-save Sessions",
"uitype": "bool",
"default": true
},
{
"name": "session_timeout_minutes",
"label": "Session Timeout (minutes)",
"uitype": "int",
"default": 60
},
{
"name": "max_concurrent_sessions",
"label": "Max Concurrent Sessions",
"uitype": "int",
"default": 10
}
]
}
},
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "auto",
"marginTop": "20px",
"gap": "10px"
},
"subwidgets": [
{
"widgettype": "Button",
"options": {
"text": "Save Settings",
"icon": "fa fa-save",
"backgroundColor": "#3B82F6",
"color": "#FFFFFF",
"border": "none",
"borderRadius": "6px",
"padding": "10px 20px"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"script": "const formData = bricks.app.get_widget('settings-form').get_data(); fetch('/hermes-web-cli/settings', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(formData) }).then(() => { alert('Settings saved successfully!'); });"
}
]
},
{
"widgettype": "Button",
"options": {
"text": "Reset to Defaults",
"backgroundColor": "#EF4444",
"color": "#FFFFFF",
"border": "none",
"borderRadius": "6px",
"padding": "10px 20px"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"script": "if (confirm('Are you sure you want to reset all settings to defaults?')) { fetch('/hermes-web-cli/settings/reset', { method: 'POST' }).then(() => { bricks.app.get_widget('settings-form').load_data(); alert('Settings reset to defaults!'); }); }"
}
]
}
]
}
]
}