From 09ec855576c2749ce2326d2b9630cfd46eaea2fc Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 22 Apr 2026 11:43:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20correct=20Button=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=92=8C=E6=A0=B7=E5=BC=8F=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将Button控件的'text'属性改为'label'(符合bricks-framework规范) - 移除所有嵌套的'style'对象,将样式属性直接放在options顶层 - 确保所有UI文件符合bricks-framework最佳实践 --- wwwroot/add_service.ui | 8 +- wwwroot/chat.ui | 6 +- wwwroot/edit_service.ui | 44 ++++----- wwwroot/index.ui | 182 +++++++++++++++----------------------- wwwroot/new_session.ui | 8 +- wwwroot/service-detail.ui | 6 +- wwwroot/services.ui | 4 +- wwwroot/session_chat.ui | 38 +++----- wwwroot/session_detail.ui | 8 +- wwwroot/settings.ui | 8 +- 10 files changed, 124 insertions(+), 188 deletions(-) diff --git a/wwwroot/add_service.ui b/wwwroot/add_service.ui index 135da0a..b61a0d0 100644 --- a/wwwroot/add_service.ui +++ b/wwwroot/add_service.ui @@ -56,13 +56,13 @@ { "widgettype": "Button", "options": { - "text": "Add Service", "icon": "fa fa-plus", "backgroundColor": "#22C55E", "color": "#FFFFFF", "border": "none", "borderRadius": "6px", - "padding": "10px 20px" + "padding": "10px 20px", + "label": "Add Service" }, "binds": [ { @@ -76,12 +76,12 @@ { "widgettype": "Button", "options": { - "text": "Cancel", "backgroundColor": "#64748B", "color": "#FFFFFF", "border": "none", "borderRadius": "6px", - "padding": "10px 20px" + "padding": "10px 20px", + "label": "Cancel" }, "binds": [ { diff --git a/wwwroot/chat.ui b/wwwroot/chat.ui index 75734fd..e71db1b 100644 --- a/wwwroot/chat.ui +++ b/wwwroot/chat.ui @@ -2,7 +2,7 @@ "widgettype": "PopupWindow", "options": { "title": "Hermes Chat", - "width": "800px", + "width": "800px", "height": "600px", "resizable": true, "draggable": true @@ -44,8 +44,8 @@ { "widgettype": "Button", "options": { - "text": "发送", - "width": "80px" + "width": "80px", + "label": "发送" }, "binds": [ { diff --git a/wwwroot/edit_service.ui b/wwwroot/edit_service.ui index 4fcd106..3f0d0c1 100644 --- a/wwwroot/edit_service.ui +++ b/wwwroot/edit_service.ui @@ -3,9 +3,7 @@ "options": { "width": "100%", "height": "100%", - "style": { - "padding": "20px" - } + "padding": "20px" }, "subwidgets": [ { @@ -14,10 +12,8 @@ "text": "Edit Service", "fontSize": "24px", "fontWeight": "bold", - "style": { - "marginBottom": "20px", - "color": "#F8FAFC" - } + "marginBottom": "20px", + "color": "#F8FAFC" } }, { @@ -54,24 +50,20 @@ "options": { "width": "100%", "height": "auto", - "style": { - "marginTop": "20px", - "gap": "10px" - } + "marginTop": "20px", + "gap": "10px" }, "subwidgets": [ { "widgettype": "Button", "options": { - "text": "Update Service", "icon": "fa fa-save", - "style": { - "backgroundColor": "#3B82F6", - "color": "#FFFFFF", - "border": "none", - "borderRadius": "6px", - "padding": "10px 20px" - } + "label": "Update Service", + "backgroundColor": "#3B82F6", + "color": "#FFFFFF", + "border": "none", + "borderRadius": "6px", + "padding": "10px 20px" }, "binds": [ { @@ -85,14 +77,12 @@ { "widgettype": "Button", "options": { - "text": "Cancel", - "style": { - "backgroundColor": "#64748B", - "color": "#FFFFFF", - "border": "none", - "borderRadius": "6px", - "padding": "10px 20px" - } + "label": "Cancel", + "backgroundColor": "#64748B", + "color": "#FFFFFF", + "border": "none", + "borderRadius": "6px", + "padding": "10px 20px" }, "binds": [ { diff --git a/wwwroot/index.ui b/wwwroot/index.ui index 25dd355..f6f4f7c 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -3,10 +3,8 @@ "options": { "width": "100%", "height": "100%", - "style": { - "backgroundColor": "#020617", - "color": "#F8FAFC" - } + "backgroundColor": "#020617", + "color": "#F8FAFC" }, "subwidgets": [ { @@ -14,12 +12,10 @@ "options": { "width": "100%", "height": "60px", - "style": { - "backgroundColor": "#0F172A", - "borderBottom": "1px solid #334155", - "padding": "0 20px", - "alignItems": "center" - } + "backgroundColor": "#0F172A", + "borderBottom": "1px solid #334155", + "padding": "0 20px", + "alignItems": "center" }, "subwidgets": [ { @@ -28,9 +24,7 @@ "text": "Hermes Web CLI", "fontSize": "24px", "fontWeight": "bold", - "style": { - "color": "#F8FAFC" - } + "color": "#F8FAFC" } }, { @@ -39,15 +33,13 @@ { "widgettype": "Button", "options": { - "text": "New Session", "icon": "fa fa-plus", - "style": { - "backgroundColor": "#22C55E", - "color": "#FFFFFF", - "border": "none", - "borderRadius": "6px", - "padding": "8px 16px" - } + "label": "New Session", + "backgroundColor": "#22C55E", + "color": "#FFFFFF", + "border": "none", + "borderRadius": "6px", + "padding": "8px 16px" }, "binds": [ { @@ -76,26 +68,22 @@ "options": { "width": "250px", "height": "100%", - "style": { - "backgroundColor": "#1A1E2F", - "borderRight": "1px solid #334155" - } + "backgroundColor": "#1A1E2F", + "borderRight": "1px solid #334155" }, "subwidgets": [ { "widgettype": "Button", "options": { - "text": "Active Sessions", "icon": "fa fa-comments", - "style": { - "width": "100%", - "textAlign": "left", - "padding": "12px 20px", - "border": "none", - "backgroundColor": "transparent", - "color": "#F8FAFC", - "fontSize": "14px" - } + "label": "Active Sessions", + "width": "100%", + "textAlign": "left", + "padding": "12px 20px", + "border": "none", + "backgroundColor": "transparent", + "color": "#F8FAFC", + "fontSize": "14px" }, "binds": [ { @@ -113,17 +101,15 @@ { "widgettype": "Button", "options": { - "text": "Services", "icon": "fa fa-server", - "style": { - "width": "100%", - "textAlign": "left", - "padding": "12px 20px", - "border": "none", - "backgroundColor": "transparent", - "color": "#F8FAFC", - "fontSize": "14px" - } + "label": "Services", + "width": "100%", + "textAlign": "left", + "padding": "12px 20px", + "border": "none", + "backgroundColor": "transparent", + "color": "#F8FAFC", + "fontSize": "14px" }, "binds": [ { @@ -141,17 +127,15 @@ { "widgettype": "Button", "options": { - "text": "Settings", "icon": "fa fa-cog", - "style": { - "width": "100%", - "textAlign": "left", - "padding": "12px 20px", - "border": "none", - "backgroundColor": "transparent", - "color": "#F8FAFC", - "fontSize": "14px" - } + "label": "Settings", + "width": "100%", + "textAlign": "left", + "padding": "12px 20px", + "border": "none", + "backgroundColor": "transparent", + "color": "#F8FAFC", + "fontSize": "14px" }, "binds": [ { @@ -174,9 +158,7 @@ "options": { "width": "calc(100% - 250px)", "height": "100%", - "style": { - "padding": "20px" - } + "padding": "20px" }, "subwidgets": [ { @@ -185,10 +167,8 @@ "text": "Welcome to Hermes Web CLI", "fontSize": "28px", "fontWeight": "bold", - "style": { - "marginBottom": "16px", - "color": "#F8FAFC" - } + "marginBottom": "16px", + "color": "#F8FAFC" } }, { @@ -196,10 +176,8 @@ "options": { "text": "Interact with your AI agents through natural language conversations. Create new sessions, manage connected services, and configure your workspace.", "fontSize": "16px", - "style": { - "marginBottom": "24px", - "color": "#CBD5E1" - } + "marginBottom": "24px", + "color": "#CBD5E1" } }, { @@ -207,9 +185,7 @@ "options": { "width": "100%", "height": "auto", - "style": { - "gap": "20px" - } + "gap": "20px" }, "subwidgets": [ { @@ -217,12 +193,10 @@ "options": { "width": "33%", "height": "120px", - "style": { - "backgroundColor": "#1E293B", - "borderRadius": "8px", - "padding": "20px", - "border": "1px solid #334155" - } + "backgroundColor": "#1E293B", + "borderRadius": "8px", + "padding": "20px", + "border": "1px solid #334155" }, "subwidgets": [ { @@ -231,10 +205,8 @@ "text": "Quick Start", "fontSize": "18px", "fontWeight": "600", - "style": { - "color": "#F8FAFC", - "marginBottom": "8px" - } + "color": "#F8FAFC", + "marginBottom": "8px" } }, { @@ -242,9 +214,7 @@ "options": { "text": "Create your first session and start chatting with your AI agent.", "fontSize": "14px", - "style": { - "color": "#94A3B8" - } + "color": "#94A3B8" } } ] @@ -254,12 +224,10 @@ "options": { "width": "33%", "height": "120px", - "style": { - "backgroundColor": "#1E293B", - "borderRadius": "8px", - "padding": "20px", - "border": "1px solid #334155" - } + "backgroundColor": "#1E293B", + "borderRadius": "8px", + "padding": "20px", + "border": "1px solid #334155" }, "subwidgets": [ { @@ -268,10 +236,8 @@ "text": "Service Management", "fontSize": "18px", "fontWeight": "600", - "style": { - "color": "#F8FAFC", - "marginBottom": "8px" - } + "color": "#F8FAFC", + "marginBottom": "8px" } }, { @@ -279,9 +245,7 @@ "options": { "text": "Connect and manage multiple Hermes services for distributed AI processing.", "fontSize": "14px", - "style": { - "color": "#94A3B8" - } + "color": "#94A3B8" } } ] @@ -291,12 +255,10 @@ "options": { "width": "33%", "height": "120px", - "style": { - "backgroundColor": "#1E293B", - "borderRadius": "8px", - "padding": "20px", - "border": "1px solid #334155" - } + "backgroundColor": "#1E293B", + "borderRadius": "8px", + "padding": "20px", + "border": "1px solid #334155" }, "subwidgets": [ { @@ -305,10 +267,8 @@ "text": "Session History", "fontSize": "18px", "fontWeight": "600", - "style": { - "color": "#F8FAFC", - "marginBottom": "8px" - } + "color": "#F8FAFC", + "marginBottom": "8px" } }, { @@ -316,9 +276,7 @@ "options": { "text": "Access your conversation history and continue previous sessions.", "fontSize": "14px", - "style": { - "color": "#94A3B8" - } + "color": "#94A3B8" } } ] @@ -331,11 +289,9 @@ "text": "Recent Sessions", "fontSize": "20px", "fontWeight": "600", - "style": { - "marginTop": "32px", - "marginBottom": "16px", - "color": "#F8FAFC" - } + "marginTop": "32px", + "marginBottom": "16px", + "color": "#F8FAFC" } }, { diff --git a/wwwroot/new_session.ui b/wwwroot/new_session.ui index 5c35afe..5b8c54e 100644 --- a/wwwroot/new_session.ui +++ b/wwwroot/new_session.ui @@ -50,13 +50,13 @@ { "widgettype": "Button", "options": { - "text": "Create Session", "icon": "fa fa-plus", "backgroundColor": "#22C55E", "color": "#FFFFFF", "border": "none", "borderRadius": "6px", - "padding": "10px 20px" + "padding": "10px 20px", + "label": "Create Session" }, "binds": [ { @@ -70,12 +70,12 @@ { "widgettype": "Button", "options": { - "text": "Cancel", "backgroundColor": "#64748B", "color": "#FFFFFF", "border": "none", "borderRadius": "6px", - "padding": "10px 20px" + "padding": "10px 20px", + "label": "Cancel" }, "binds": [ { diff --git a/wwwroot/service-detail.ui b/wwwroot/service-detail.ui index 7b8e664..60282de 100644 --- a/wwwroot/service-detail.ui +++ b/wwwroot/service-detail.ui @@ -4,14 +4,14 @@ "title": "服务详情", "fields": [ { - "name": "name", + "name": "name", "label": "服务名称", "uitype": "str", "required": true }, { "name": "service_url", - "label": "服务地址", + "label": "服务地址", "uitype": "str", "required": true }, @@ -27,7 +27,7 @@ { "wid": "self", "event": "submited", - "actiontype": "script", + "actiontype": "script", "script": "await bricks.show_resp_message_or_error(event.params)" } ] diff --git a/wwwroot/services.ui b/wwwroot/services.ui index 9a4421d..d842eb6 100644 --- a/wwwroot/services.ui +++ b/wwwroot/services.ui @@ -19,14 +19,14 @@ { "widgettype": "Button", "options": { - "text": "Add New Service", "icon": "fa fa-plus", "backgroundColor": "#22C55E", "color": "#FFFFFF", "border": "none", "borderRadius": "6px", "padding": "10px 20px", - "marginBottom": "20px" + "marginBottom": "20px", + "label": "Add New Service" }, "binds": [ { diff --git a/wwwroot/session_chat.ui b/wwwroot/session_chat.ui index 1f5a247..e2cddb8 100644 --- a/wwwroot/session_chat.ui +++ b/wwwroot/session_chat.ui @@ -3,9 +3,7 @@ "options": { "width": "100%", "height": "100%", - "style": { - "padding": "20px" - } + "padding": "20px" }, "subwidgets": [ { @@ -13,9 +11,7 @@ "options": { "width": "100%", "height": "auto", - "style": { - "marginBottom": "24px" - } + "marginBottom": "24px" }, "subwidgets": [ { @@ -24,9 +20,7 @@ "text": "Session Chat", "fontSize": "24px", "fontWeight": "bold", - "style": { - "color": "#F8FAFC" - } + "color": "#F8FAFC" } }, { @@ -35,15 +29,13 @@ { "widgettype": "Button", "options": { - "text": "Back to Sessions", "icon": "fa fa-arrow-left", - "style": { - "backgroundColor": "#1E293B", - "color": "#F8FAFC", - "border": "1px solid #334155", - "borderRadius": "6px", - "padding": "8px 16px" - } + "label": "Back to Sessions", + "backgroundColor": "#1E293B", + "color": "#F8FAFC", + "border": "1px solid #334155", + "borderRadius": "6px", + "padding": "8px 16px" }, "binds": [ { @@ -65,13 +57,11 @@ "options": { "width": "100%", "height": "calc(100% - 100px)", - "style": { - "backgroundColor": "#1E293B", - "borderRadius": "8px", - "padding": "20px", - "border": "1px solid #334155", - "overflow": "auto" - } + "backgroundColor": "#1E293B", + "borderRadius": "8px", + "padding": "20px", + "border": "1px solid #334155", + "overflow": "auto" }, "subwidgets": [ { diff --git a/wwwroot/session_detail.ui b/wwwroot/session_detail.ui index 051f55c..08d4e7e 100644 --- a/wwwroot/session_detail.ui +++ b/wwwroot/session_detail.ui @@ -70,13 +70,13 @@ { "widgettype": "Button", "options": { - "text": "Send", "icon": "fa fa-paper-plane", "backgroundColor": "#22C55E", "color": "#FFFFFF", "border": "none", "borderRadius": "6px", - "padding": "10px 20px" + "padding": "10px 20px", + "label": "Send" }, "binds": [ { @@ -90,12 +90,12 @@ { "widgettype": "Button", "options": { - "text": "Back to Sessions", "backgroundColor": "#64748B", "color": "#FFFFFF", "border": "none", "borderRadius": "6px", - "padding": "10px 20px" + "padding": "10px 20px", + "label": "Back to Sessions" }, "binds": [ { diff --git a/wwwroot/settings.ui b/wwwroot/settings.ui index 9c9dea7..3fa7f04 100644 --- a/wwwroot/settings.ui +++ b/wwwroot/settings.ui @@ -60,13 +60,13 @@ { "widgettype": "Button", "options": { - "text": "Save Settings", "icon": "fa fa-save", "backgroundColor": "#3B82F6", "color": "#FFFFFF", "border": "none", "borderRadius": "6px", - "padding": "10px 20px" + "padding": "10px 20px", + "label": "Save Settings" }, "binds": [ { @@ -80,12 +80,12 @@ { "widgettype": "Button", "options": { - "text": "Reset to Defaults", "backgroundColor": "#EF4444", "color": "#FFFFFF", "border": "none", "borderRadius": "6px", - "padding": "10px 20px" + "padding": "10px 20px", + "label": "Reset to Defaults" }, "binds": [ {