From 701aedfa5ad607193a1c8a63ade80a205e5ffea9 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 22 Apr 2026 17:17:34 +0800 Subject: [PATCH] =?UTF-8?q?Fix=20settings.ui:=20Replace=20non-existent=20T?= =?UTF-8?q?abs=E6=8E=A7=E4=BB=B6=20with=20TabPanel=E6=8E=A7=E4=BB=B6=20and?= =?UTF-8?q?=20ensure=20Form=E6=8E=A7=E4=BB=B6=20uses=20correct=20options.f?= =?UTF-8?q?ields=20structure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/settings.ui | 486 ++++++++++++++++++++++---------------------- 1 file changed, 238 insertions(+), 248 deletions(-) diff --git a/wwwroot/settings.ui b/wwwroot/settings.ui index 8d58a8e..3c2edef 100644 --- a/wwwroot/settings.ui +++ b/wwwroot/settings.ui @@ -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" + "label": "AI Models", + "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}}" - } - } - ] - } - ] - } - ] + } + ] + } } ] } \ No newline at end of file