hermes-web-cli/wwwroot/settings.ui
yumoqing 3edfa140e9 Fix bricks framework API usage and file structure
- Move all JS files from wwwroot/scripts/ to wwwroot/ root directory to comply with ahserver requirements
- Fix component registration: use bricks.Factory.register() instead of bricks.register()
- Fix function registration: use bricks.RF.register() instead of bricks.registerFunction()
- Update UI files to use item_template_url with external templates for List components
- Add proper list item template files (session-list-item.ui, service-list-item.ui, model-list-item.ui)
- Ensure all custom components and functions use correct bricks framework API
2026-04-22 15:49:36 +08:00

306 lines
9.0 KiB
XML

{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "Settings",
"fontSize": "24px",
"fontWeight": "bold",
"color": "#F8FAFC",
"marginBottom": "20px"
}
},
{
"widgettype": "Tabs",
"id": "settings-tabs",
"options": {
"width": "100%",
"height": "calc(100% - 60px)",
"tabs": [
{
"label": "General",
"id": "general-tab"
},
{
"label": "AI Models",
"id": "models-tab"
},
{
"label": "Security",
"id": "security-tab"
},
{
"label": "Appearance",
"id": "appearance-tab"
}
]
},
"subwidgets": [
{
"widgettype": "VBox",
"id": "general-tab",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Form",
"options": {
"width": "100%",
"maxWidth": "600px"
},
"subwidgets": [
{
"widgettype": "UiCode",
"id": "default-model",
"options": {
"name": "default-model",
"label": "Default AI Model",
"placeholder": "Select default model...",
"width": "100%",
"marginBottom": "16px"
}
},
{
"widgettype": "UiInt",
"id": "session-timeout",
"options": {
"name": "session-timeout",
"label": "Session Timeout (minutes)",
"placeholder": "Enter timeout in minutes...",
"width": "100%",
"marginBottom": "16px"
}
},
{
"widgettype": "UiCheck",
"id": "auto-save",
"options": {
"name": "auto-save",
"label": "Auto-save sessions",
"checked": true,
"marginBottom": "24px"
}
},
{
"widgettype": "Button",
"options": {
"label": "Save General Settings",
"bgcolor": "#22C55E",
"color": "#FFFFFF",
"border": "none",
"borderRadius": "6px",
"padding": "10px 20px",
"fontWeight": "600"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "registerfunction",
"target": "self",
"rfname": "save_general_settings",
"params": {
"default_model": "{{default-model.value}}",
"session_timeout": "{{session-timeout.value}}",
"auto_save": "{{auto-save.checked}}"
}
}
]
}
]
}
]
},
{
"widgettype": "VBox",
"id": "models-tab",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "Configure AI Models",
"fontSize": "18px",
"fontWeight": "600",
"color": "#F8FAFC",
"marginBottom": "16px"
}
},
{
"widgettype": "List",
"id": "models-list",
"options": {
"width": "100%",
"height": "calc(100% - 80px)",
"itemHeight": "120px",
"data_url": "/hermes-web-cli/models/list/",
"item_template_url": "{{entire_url('model-list-item.ui')}}"
}
},
{
"widgettype": "Button",
"options": {
"label": "Add New Model",
"bgcolor": "#22C55E",
"color": "#FFFFFF",
"border": "none",
"borderRadius": "6px",
"padding": "8px 16px",
"marginTop": "12px"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "registerfunction",
"target": "self",
"rfname": "add_model",
"params": {}
}
]
}
]
},
{
"widgettype": "VBox",
"id": "security-tab",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "Security Settings",
"fontSize": "18px",
"fontWeight": "600",
"color": "#F8FAFC",
"marginBottom": "16px"
}
},
{
{
"widgettype": "UiCheck",
"options": {
"name": "require-auth",
"label": "Require authentication for API access",
"checked": "{{security.require_auth}}",
"marginBottom": "12px"
}
},
{
"widgettype": "UiCheck",
"options": {
"name": "encrypt-storage",
"label": "Encrypt local storage",
"checked": "{{security.encrypt_storage}}",
"marginBottom": "24px"
"marginBottom": "24px"
}
},
{
"widgettype": "Button",
"options": {
"label": "Save Security Settings",
"bgcolor": "#22C55E",
"color": "#FFFFFF",
"border": "none",
"borderRadius": "6px",
"padding": "10px 20px",
"fontWeight": "600"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "registerfunction",
"target": "self",
"rfname": "save_security_settings",
"params": {
"require_auth": "{{require-auth.checked}}",
"encrypt_storage": "{{encrypt-storage.checked}}"
}
}
]
}
]
},
{
"widgettype": "VBox",
"id": "appearance-tab",
"options": {
"width": "100%",
"height": "100%",
"padding": "20px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"text": "Appearance Settings",
"fontSize": "18px",
"fontWeight": "600",
"color": "#F8FAFC",
"marginBottom": "16px"
}
},
{
"widgettype": "Select",
"id": "theme-select",
"options": {
"label": "Theme",
"items": [
{"label": "Dark", "value": "dark"},
{"label": "Light", "value": "light"},
{"label": "System", "value": "system"}
],
"value": "dark",
"width": "200px",
"marginBottom": "24px"
}
},
{
"widgettype": "Button",
"options": {
"label": "Save Appearance Settings",
"bgcolor": "#22C55E",
"color": "#FFFFFF",
"border": "none",
"borderRadius": "6px",
"padding": "10px 20px",
"fontWeight": "600"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "registerfunction",
"target": "self",
"rfname": "save_appearance_settings",
"params": {
"theme": "{{theme-select.value}}"
}
}
]
}
]
}
]
}
]
}