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",
|
"id": "settings-tabs",
|
||||||
"options": {
|
"options": {
|
||||||
"width": "100%",
|
"width": "100%",
|
||||||
@ -25,270 +25,260 @@
|
|||||||
"tabs": [
|
"tabs": [
|
||||||
{
|
{
|
||||||
"label": "General",
|
"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",
|
"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",
|
"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",
|
"label": "Appearance",
|
||||||
"id": "appearance-tab"
|
"content": {
|
||||||
}
|
"widgettype": "VBox",
|
||||||
]
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "VBox",
|
|
||||||
"id": "general-tab",
|
|
||||||
"options": {
|
|
||||||
"width": "100%",
|
|
||||||
"height": "100%",
|
|
||||||
"padding": "20px"
|
|
||||||
},
|
|
||||||
"subwidgets": [
|
|
||||||
{
|
|
||||||
"widgettype": "Form",
|
|
||||||
"id": "general-settings-form",
|
|
||||||
"options": {
|
"options": {
|
||||||
"width": "100%",
|
"width": "100%",
|
||||||
"maxWidth": "600px",
|
"height": "100%",
|
||||||
"fields": [
|
"padding": "20px"
|
||||||
{
|
},
|
||||||
"widgettype": "UiCode",
|
"subwidgets": [
|
||||||
"name": "default-model",
|
{
|
||||||
"label": "Default AI Model",
|
"widgettype": "Text",
|
||||||
"placeholder": "Select default model...",
|
"options": {
|
||||||
"width": "100%",
|
"text": "Appearance Settings",
|
||||||
|
"fontSize": "18px",
|
||||||
|
"fontWeight": "600",
|
||||||
|
"color": "#F8FAFC",
|
||||||
"marginBottom": "16px"
|
"marginBottom": "16px"
|
||||||
},
|
}
|
||||||
{
|
},
|
||||||
"widgettype": "UiInt",
|
{
|
||||||
"name": "session-timeout",
|
"widgettype": "Select",
|
||||||
"label": "Session Timeout (minutes)",
|
"id": "theme-select",
|
||||||
"placeholder": "Enter timeout in minutes...",
|
"options": {
|
||||||
"width": "100%",
|
"label": "Theme",
|
||||||
"marginBottom": "16px"
|
"items": [
|
||||||
},
|
{"label": "Dark", "value": "dark"},
|
||||||
{
|
{"label": "Light", "value": "light"},
|
||||||
"widgettype": "UiCheck",
|
{"label": "System", "value": "system"}
|
||||||
"name": "auto-save",
|
],
|
||||||
"label": "Auto-save sessions",
|
"value": "dark",
|
||||||
"checked": true,
|
"width": "200px",
|
||||||
"marginBottom": "24px"
|
"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",
|
"widgettype": "Button",
|
||||||
"event": "click",
|
"options": {
|
||||||
"actiontype": "registerfunction",
|
"label": "Save Appearance Settings",
|
||||||
"target": "app.general-tab",
|
"bgcolor": "#22C55E",
|
||||||
"rfname": "save_general_settings",
|
"color": "#FFFFFF",
|
||||||
"params": {
|
"border": "none",
|
||||||
"form_data": "{{ 'general-settings-form'.data }}"
|
"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