Fix Form控件结构: ensure all Form controls use options.fields instead of subwidgets

This commit is contained in:
yumoqing 2026-04-22 16:39:31 +08:00
parent eee254da60
commit 30eae89807

View File

@ -53,42 +53,36 @@
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "Form", "widgettype": "Form",
"id": "general-settings-form",
"options": { "options": {
"width": "100%", "width": "100%",
"maxWidth": "600px" "maxWidth": "600px",
}, "fields": [
"subwidgets": [
{ {
"widgettype": "UiCode", "widgettype": "UiCode",
"id": "default-model",
"options": {
"name": "default-model", "name": "default-model",
"label": "Default AI Model", "label": "Default AI Model",
"placeholder": "Select default model...", "placeholder": "Select default model...",
"width": "100%", "width": "100%",
"marginBottom": "16px" "marginBottom": "16px"
}
}, },
{ {
"widgettype": "UiInt", "widgettype": "UiInt",
"id": "session-timeout",
"options": {
"name": "session-timeout", "name": "session-timeout",
"label": "Session Timeout (minutes)", "label": "Session Timeout (minutes)",
"placeholder": "Enter timeout in minutes...", "placeholder": "Enter timeout in minutes...",
"width": "100%", "width": "100%",
"marginBottom": "16px" "marginBottom": "16px"
}
}, },
{ {
"widgettype": "UiCheck", "widgettype": "UiCheck",
"id": "auto-save",
"options": {
"name": "auto-save", "name": "auto-save",
"label": "Auto-save sessions", "label": "Auto-save sessions",
"checked": true, "checked": true,
"marginBottom": "24px" "marginBottom": "24px"
} }
]
}
}, },
{ {
"widgettype": "Button", "widgettype": "Button",
@ -106,19 +100,15 @@
"wid": "self", "wid": "self",
"event": "click", "event": "click",
"actiontype": "registerfunction", "actiontype": "registerfunction",
"target": "self", "target": "app.general-tab",
"rfname": "save_general_settings", "rfname": "save_general_settings",
"params": { "params": {
"default_model": "{{default-model.value}}", "form_data": "{{general-settings-form.data}}"
"session_timeout": "{{session-timeout.value}}",
"auto_save": "{{auto-save.checked}}"
} }
} }
] ]
} }
] ]
}
]
}, },
{ {
"widgettype": "VBox", "widgettype": "VBox",
@ -166,7 +156,7 @@
"wid": "self", "wid": "self",
"event": "click", "event": "click",
"actiontype": "registerfunction", "actiontype": "registerfunction",
"target": "self", "target": "app.models-tab",
"rfname": "add_model", "rfname": "add_model",
"params": {} "params": {}
} }
@ -193,7 +183,6 @@
"marginBottom": "16px" "marginBottom": "16px"
} }
}, },
{
{ {
"widgettype": "UiCheck", "widgettype": "UiCheck",
"options": { "options": {
@ -210,7 +199,6 @@
"label": "Encrypt local storage", "label": "Encrypt local storage",
"checked": "{{security.encrypt_storage}}", "checked": "{{security.encrypt_storage}}",
"marginBottom": "24px" "marginBottom": "24px"
"marginBottom": "24px"
} }
}, },
{ {
@ -229,7 +217,7 @@
"wid": "self", "wid": "self",
"event": "click", "event": "click",
"actiontype": "registerfunction", "actiontype": "registerfunction",
"target": "self", "target": "app.security-tab",
"rfname": "save_security_settings", "rfname": "save_security_settings",
"params": { "params": {
"require_auth": "{{require-auth.checked}}", "require_auth": "{{require-auth.checked}}",
@ -290,7 +278,7 @@
"wid": "self", "wid": "self",
"event": "click", "event": "click",
"actiontype": "registerfunction", "actiontype": "registerfunction",
"target": "self", "target": "app.appearance-tab",
"rfname": "save_appearance_settings", "rfname": "save_appearance_settings",
"params": { "params": {
"theme": "{{theme-select.value}}" "theme": "{{theme-select.value}}"