Fix settings.ui: Replace non-existent Tabs控件 with TabPanel控件 and ensure Form控件 uses correct options.fields structure
This commit is contained in:
parent
02b2cdaeec
commit
701aedfa5a
@ -17,7 +17,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "Tabs",
|
||||
"widgettype": "TabPanel",
|
||||
"id": "settings-tabs",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
@ -25,270 +25,260 @@
|
||||
"tabs": [
|
||||
{
|
||||
"label": "General",
|
||||
"id": "general-tab"
|
||||
"content": {
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"height": "100%",
|
||||
"padding": "20px"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Form",
|
||||
"id": "general-settings-form",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"maxWidth": "600px",
|
||||
"fields": [
|
||||
{
|
||||
"widgettype": "UiCode",
|
||||
"name": "default-model",
|
||||
"label": "Default AI Model",
|
||||
"placeholder": "Select default model...",
|
||||
"width": "100%",
|
||||
"marginBottom": "16px"
|
||||
},
|
||||
{
|
||||
"widgettype": "UiInt",
|
||||
"name": "session-timeout",
|
||||
"label": "Session Timeout (minutes)",
|
||||
"placeholder": "Enter timeout in minutes...",
|
||||
"width": "100%",
|
||||
"marginBottom": "16px"
|
||||
},
|
||||
{
|
||||
"widgettype": "UiCheck",
|
||||
"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": "app.settings-tabs",
|
||||
"rfname": "save_general_settings",
|
||||
"params": {
|
||||
"form_data": "{{ 'general-settings-form'.data }}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "AI Models",
|
||||
"id": "models-tab"
|
||||
"content": {
|
||||
"widgettype": "VBox",
|
||||
"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": "app.settings-tabs",
|
||||
"rfname": "add_model",
|
||||
"params": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Security",
|
||||
"id": "security-tab"
|
||||
"content": {
|
||||
"widgettype": "VBox",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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": "app.settings-tabs",
|
||||
"rfname": "save_security_settings",
|
||||
"params": {
|
||||
"require_auth": "{{require-auth.checked}}",
|
||||
"encrypt_storage": "{{encrypt-storage.checked}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "Appearance",
|
||||
"id": "appearance-tab"
|
||||
}
|
||||
]
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "VBox",
|
||||
"id": "general-tab",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"height": "100%",
|
||||
"padding": "20px"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Form",
|
||||
"id": "general-settings-form",
|
||||
"content": {
|
||||
"widgettype": "VBox",
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"maxWidth": "600px",
|
||||
"fields": [
|
||||
{
|
||||
"widgettype": "UiCode",
|
||||
"name": "default-model",
|
||||
"label": "Default AI Model",
|
||||
"placeholder": "Select default model...",
|
||||
"width": "100%",
|
||||
"height": "100%",
|
||||
"padding": "20px"
|
||||
},
|
||||
"subwidgets": [
|
||||
{
|
||||
"widgettype": "Text",
|
||||
"options": {
|
||||
"text": "Appearance Settings",
|
||||
"fontSize": "18px",
|
||||
"fontWeight": "600",
|
||||
"color": "#F8FAFC",
|
||||
"marginBottom": "16px"
|
||||
},
|
||||
{
|
||||
"widgettype": "UiInt",
|
||||
"name": "session-timeout",
|
||||
"label": "Session Timeout (minutes)",
|
||||
"placeholder": "Enter timeout in minutes...",
|
||||
"width": "100%",
|
||||
"marginBottom": "16px"
|
||||
},
|
||||
{
|
||||
"widgettype": "UiCheck",
|
||||
"name": "auto-save",
|
||||
"label": "Auto-save sessions",
|
||||
"checked": true,
|
||||
}
|
||||
},
|
||||
{
|
||||
"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 General Settings",
|
||||
"bgcolor": "#22C55E",
|
||||
"color": "#FFFFFF",
|
||||
"border": "none",
|
||||
"borderRadius": "6px",
|
||||
"padding": "10px 20px",
|
||||
"fontWeight": "600"
|
||||
},
|
||||
"binds": [
|
||||
},
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "click",
|
||||
"actiontype": "registerfunction",
|
||||
"target": "app.general-tab",
|
||||
"rfname": "save_general_settings",
|
||||
"params": {
|
||||
"form_data": "{{ 'general-settings-form'.data }}"
|
||||
}
|
||||
"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": "app.settings-tabs",
|
||||
"rfname": "save_appearance_settings",
|
||||
"params": {
|
||||
"theme": "{{theme-select.value}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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": "app.models-tab",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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": "app.security-tab",
|
||||
"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": "app.appearance-tab",
|
||||
"rfname": "save_appearance_settings",
|
||||
"params": {
|
||||
"theme": "{{theme-select.value}}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user