From bb7e5ef5accdff367cec8e77251d170084e7118d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Wed, 12 Aug 2026 12:58:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Bricks=20index.ui=20(ref=20Sage=20patte?= =?UTF-8?q?rn)=20=E2=80=94=20topbar=20with=20user=5Fpanel=20urlwidget,=20s?= =?UTF-8?q?idebar=20menu,=20dashboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup_rbac_perms.sh | 2 + wwwroot/index.ui | 311 ++++++++++++++++++++++++++++++++------------ 2 files changed, 230 insertions(+), 83 deletions(-) diff --git a/setup_rbac_perms.sh b/setup_rbac_perms.sh index 4b09823..9fdee3f 100644 --- a/setup_rbac_perms.sh +++ b/setup_rbac_perms.sh @@ -36,6 +36,8 @@ PUBLIC_PATHS=( "/rbac/user/code_login.dspy" "/rbac/user/sms_register.dspy" "/rbac/get_user_info.dspy" + "/rbac/user/user_panel.ui" + "/appbase/menu.ui" ) for path in "${PUBLIC_PATHS[@]}"; do diff --git a/wwwroot/index.ui b/wwwroot/index.ui index da14957..2476ae8 100644 --- a/wwwroot/index.ui +++ b/wwwroot/index.ui @@ -1,132 +1,277 @@ { - "widgettype": "HBox", - "id": "pccs_root", - "options": {"width": "100%", "height": "100%"}, + "widgettype": "VBox", + "options": { + "width": "100%", + "height": "100%", + "bgcolor": "#f8fafc" + }, "subwidgets": [ { - "widgettype": "VBox", - "id": "pccs_sidebar", + "widgettype": "HBox", "options": { - "width": "220px", - "height": "100%", - "bgcolor": "#0f172a", - "padding": "0", - "flexShrink": "0" + "width": "100%", + "cheight": 2.5, + "padding": "0 16px", + "alignItems": "center", + "bgcolor": "#ffffff", + "borderBottom": "1px solid #e2e8f0" }, "subwidgets": [ { - "widgettype": "VBox", + "widgettype": "Button", + "id": "sidebar_toggle_btn", "options": { - "padding": "20px 16px", - "borderBottom": "1px solid #1e293b" + "css": "text", + "label": "☰", + "cfontsize": 1.4, + "color": "#64748b" }, - "subwidgets": [ - {"widgettype": "Text", "options": { - "otext": "PCCS", - "cfontsize": 1.3, - "fontWeight": "bold", - "color": "#e2e8f0" - }}, - {"widgettype": "Text", "options": { - "otext": "算力中心集群系统", - "cfontsize": 0.75, - "color": "#64748b" - }} + "binds": [ + { + "wid": "self", + "event": "click", + "actiontype": "method", + "target": "pccs_sidebar", + "method": "toggle_collapse" + } ] }, { - "widgettype": "VBox", - "id": "pccs_menu", - "options": {"padding": "8px", "gap": "2px"}, - "subwidgets": [ - {"widgettype": "Text", "options": { - "otext": "主导航", - "cfontsize": 0.7, - "color": "#475569", - "padding": "8px 8px 4px 8px", - "fontWeight": "bold" - }} - ] + "widgettype": "Text", + "options": { + "otext": "PCCS", + "cfontsize": 1.2, + "fontWeight": "bold", + "color": "#1e293b", + "padding": "0 8px" + } + }, + { + "widgettype": "Text", + "options": { + "otext": "算力中心集群系统", + "cfontsize": 0.8, + "color": "#94a3b8" + } + }, + { + "widgettype": "Filler" + }, + { + "widgettype": "urlwidget", + "options": { + "url": "{{entire_url('i18n/language.ui')}}" + } + }, + { + "widgettype": "urlwidget", + "options": { + "url": "{{entire_url('/rbac/user/user_panel.ui')}}" + } } ] }, { - "widgettype": "VBox", - "id": "pccs_main", + "widgettype": "HBox", "options": { "css": "filler", - "bgcolor": "#f8fafc", - "overflow": "auto" + "padding": "0", + "gap": "0" }, "subwidgets": [ { "widgettype": "VBox", - "id": "dashboard_header", + "id": "pccs_sidebar", "options": { - "bgcolor": "#ffffff", - "borderBottom": "1px solid #e2e8f0", - "padding": "16px 24px" + "width": "220px", + "minWidth": "200px", + "height": "100%", + "bgcolor": "#0f172a", + "padding": "0", + "flexShrink": "0" }, - "subwidgets": [ - {"widgettype": "Text", "options": { - "otext": "概览", - "cfontsize": 1.3, - "fontWeight": "bold", - "color": "#1e293b" - }}, - {"widgettype": "Text", "options": { - "otext": "算力中心资源总览", - "cfontsize": 0.85, - "color": "#64748b" - }} - ] - }, - { - "widgettype": "VBox", - "id": "dashboard_content", - "options": {"css": "filler", "padding": "24px", "gap": "20px", "overflow": "auto"}, "subwidgets": [ { - "widgettype": "HBox", - "options": {"gap": "16px"}, + "widgettype": "VBox", + "options": { + "padding": "20px 16px", + "borderBottom": "1px solid #1e293b" + }, "subwidgets": [ { - "widgettype": "urlwidget", - "id": "card_pool", + "widgettype": "Text", "options": { - "url": "{{entire_url('/pcpool/api/pool_stats.dspy')}}", - "method": "GET" + "otext": "PCCS", + "cfontsize": 1.3, + "fontWeight": "bold", + "color": "#e2e8f0" } }, { - "widgettype": "urlwidget", - "id": "card_cluster", + "widgettype": "Text", "options": { - "url": "{{entire_url('/pcc/api/cluster_status_all.dspy')}}", - "method": "GET" + "otext": "算力中心集群系统", + "cfontsize": 0.75, + "color": "#64748b" } } ] }, { - "widgettype": "HBox", - "options": {"gap": "16px"}, + "widgettype": "Menu", + "id": "pccs_menu", + "options": { + "width": "100%", + "height": "100%", + "target": "pccs_main", + "items": [ + { + "name": "dashboard", + "label": "📊 概览", + "icon": "", + "url": "{{entire_url('/')}}" + }, + { + "name": "compute_pool", + "label": "📦 算力池列表", + "icon": "", + "url": "{{entire_url('/pcpool/compute_pool_list/index.ui')}}" + }, + { + "name": "compute_node", + "label": "📦 算力节点", + "icon": "", + "url": "{{entire_url('/pcpool/compute_node_list/index.ui')}}" + }, + { + "name": "cluster_list", + "label": "🖥 集群列表", + "icon": "", + "url": "{{entire_url('/pcc/cluster_list/index.ui')}}" + }, + { + "name": "cluster_node", + "label": "🖥 节点分配", + "icon": "", + "url": "{{entire_url('/pcc/cluster_node_list/index.ui')}}" + }, + { + "name": "storage_server", + "label": "💾 存储服务器", + "icon": "", + "url": "{{entire_url('/storage_mgr/storage_server_list/index.ui')}}" + }, + { + "name": "storage_export", + "label": "💾 存储导出", + "icon": "", + "url": "{{entire_url('/storage_mgr/storage_export_list/index.ui')}}" + }, + { + "name": "storage_mount", + "label": "💾 存储挂载", + "icon": "", + "url": "{{entire_url('/storage_mgr/storage_mount_list/index.ui')}}" + }, + { + "name": "mirror_source", + "label": "🏗 镜像源", + "icon": "", + "url": "{{entire_url('/image_mgr/mirror_source_list/index.ui')}}" + }, + { + "name": "image_registry", + "label": "🏗 镜像仓库", + "icon": "", + "url": "{{entire_url('/image_mgr/image_registry_list/index.ui')}}" + }, + { + "name": "container_image", + "label": "🏗 容器镜像", + "icon": "", + "url": "{{entire_url('/image_mgr/container_image_list/index.ui')}}" + } + ] + } + } + ] + }, + { + "widgettype": "VScrollPanel", + "id": "pccs_main", + "options": { + "css": "filler", + "width": "100%", + "height": "100%" + }, + "subwidgets": [ + { + "widgettype": "VBox", + "options": { + "padding": "32px", + "spacing": "24px" + }, "subwidgets": [ { - "widgettype": "urlwidget", - "id": "card_storage", + "widgettype": "Text", "options": { - "url": "{{entire_url('/storage_mgr/api/storage_stats.dspy')}}", - "method": "GET" + "otext": "概览", + "cfontsize": 1.5, + "fontWeight": "bold", + "color": "#1e293b" } }, { - "widgettype": "urlwidget", - "id": "card_image", + "widgettype": "Text", "options": { - "url": "{{entire_url('/image_mgr/api/image_stats.dspy')}}", - "method": "GET" + "otext": "算力中心资源总览", + "cfontsize": 0.9, + "color": "#64748b" } + }, + { + "widgettype": "HBox", + "options": {"gap": "16px"}, + "subwidgets": [ + { + "widgettype": "urlwidget", + "id": "card_pool", + "options": { + "url": "{{entire_url('/pcpool/api/pool_stats.dspy')}}", + "method": "GET" + } + }, + { + "widgettype": "urlwidget", + "id": "card_cluster", + "options": { + "url": "{{entire_url('/pcc/api/cluster_status_all.dspy')}}", + "method": "GET" + } + } + ] + }, + { + "widgettype": "HBox", + "options": {"gap": "16px"}, + "subwidgets": [ + { + "widgettype": "urlwidget", + "id": "card_storage", + "options": { + "url": "{{entire_url('/storage_mgr/api/storage_stats.dspy')}}", + "method": "GET" + } + }, + { + "widgettype": "urlwidget", + "id": "card_image", + "options": { + "url": "{{entire_url('/image_mgr/api/image_stats.dspy')}}", + "method": "GET" + } + } + ] } ] }