Fix settings.ui: Correct TabPanel structure using items instead of tabs, and use Form toolbar actions with proper uitype in fields
This commit is contained in:
parent
701aedfa5a
commit
14ed67907a
@ -22,8 +22,10 @@
|
||||
"options": {
|
||||
"width": "100%",
|
||||
"height": "calc(100% - 60px)",
|
||||
"tabs": [
|
||||
"tab_pos": "top",
|
||||
"items": [
|
||||
{
|
||||
"name": "general",
|
||||
"label": "General",
|
||||
"content": {
|
||||
"widgettype": "VBox",
|
||||
@ -41,7 +43,7 @@
|
||||
"maxWidth": "600px",
|
||||
"fields": [
|
||||
{
|
||||
"widgettype": "UiCode",
|
||||
"uitype": "code",
|
||||
"name": "default-model",
|
||||
"label": "Default AI Model",
|
||||
"placeholder": "Select default model...",
|
||||
@ -49,7 +51,7 @@
|
||||
"marginBottom": "16px"
|
||||
},
|
||||
{
|
||||
"widgettype": "UiInt",
|
||||
"uitype": "int",
|
||||
"name": "session-timeout",
|
||||
"label": "Session Timeout (minutes)",
|
||||
"placeholder": "Enter timeout in minutes...",
|
||||
@ -57,30 +59,32 @@
|
||||
"marginBottom": "16px"
|
||||
},
|
||||
{
|
||||
"widgettype": "UiCheck",
|
||||
"uitype": "check",
|
||||
"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"
|
||||
],
|
||||
"toolbar": {
|
||||
"tools": [
|
||||
{
|
||||
"label": "Save General Settings",
|
||||
"bgcolor": "#22C55E",
|
||||
"color": "#FFFFFF",
|
||||
"border": "none",
|
||||
"borderRadius": "6px",
|
||||
"padding": "10px 20px",
|
||||
"fontWeight": "600",
|
||||
"action": "save_general_settings"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"binds": [
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "click",
|
||||
"event": "save_general_settings",
|
||||
"actiontype": "registerfunction",
|
||||
"target": "app.settings-tabs",
|
||||
"rfname": "save_general_settings",
|
||||
@ -94,6 +98,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "models",
|
||||
"label": "AI Models",
|
||||
"content": {
|
||||
"widgettype": "VBox",
|
||||
@ -150,95 +155,73 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "security",
|
||||
"label": "Security",
|
||||
"content": {
|
||||
"widgettype": "VBox",
|
||||
"widgettype": "Form",
|
||||
"id": "security-settings-form",
|
||||
"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": {
|
||||
"maxWidth": "600px",
|
||||
"fields": [
|
||||
{
|
||||
"uitype": "check",
|
||||
"name": "require-auth",
|
||||
"label": "Require authentication for API access",
|
||||
"checked": "{{security.require_auth}}",
|
||||
"marginBottom": "12px"
|
||||
}
|
||||
},
|
||||
{
|
||||
"widgettype": "UiCheck",
|
||||
"options": {
|
||||
},
|
||||
{
|
||||
"uitype": "check",
|
||||
"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": [
|
||||
],
|
||||
"toolbar": {
|
||||
"tools": [
|
||||
{
|
||||
"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": "Save Security Settings",
|
||||
"bgcolor": "#22C55E",
|
||||
"color": "#FFFFFF",
|
||||
"border": "none",
|
||||
"borderRadius": "6px",
|
||||
"padding": "10px 20px",
|
||||
"fontWeight": "600",
|
||||
"action": "save_security_settings"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"binds": [
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "save_security_settings",
|
||||
"actiontype": "registerfunction",
|
||||
"target": "app.settings-tabs",
|
||||
"rfname": "save_security_settings",
|
||||
"params": {
|
||||
"require_auth": "{{ 'security-settings-form'.data['require-auth'] }}",
|
||||
"encrypt_storage": "{{ 'security-settings-form'.data['encrypt-storage'] }}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "appearance",
|
||||
"label": "Appearance",
|
||||
"content": {
|
||||
"widgettype": "VBox",
|
||||
"widgettype": "Form",
|
||||
"id": "appearance-settings-form",
|
||||
"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": {
|
||||
"maxWidth": "600px",
|
||||
"fields": [
|
||||
{
|
||||
"uitype": "select",
|
||||
"name": "theme",
|
||||
"label": "Theme",
|
||||
"items": [
|
||||
{"label": "Dark", "value": "dark"},
|
||||
@ -249,31 +232,33 @@
|
||||
"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": [
|
||||
],
|
||||
"toolbar": {
|
||||
"tools": [
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "click",
|
||||
"actiontype": "registerfunction",
|
||||
"target": "app.settings-tabs",
|
||||
"rfname": "save_appearance_settings",
|
||||
"params": {
|
||||
"theme": "{{theme-select.value}}"
|
||||
}
|
||||
"label": "Save Appearance Settings",
|
||||
"bgcolor": "#22C55E",
|
||||
"color": "#FFFFFF",
|
||||
"border": "none",
|
||||
"borderRadius": "6px",
|
||||
"padding": "10px 20px",
|
||||
"fontWeight": "600",
|
||||
"action": "save_appearance_settings"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"binds": [
|
||||
{
|
||||
"wid": "self",
|
||||
"event": "save_appearance_settings",
|
||||
"actiontype": "registerfunction",
|
||||
"target": "app.settings-tabs",
|
||||
"rfname": "save_appearance_settings",
|
||||
"params": {
|
||||
"theme": "{{ 'appearance-settings-form'.data.theme }}"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user