feat: Bricks index.ui (ref Sage pattern) — topbar with user_panel urlwidget, sidebar menu, dashboard

This commit is contained in:
yumoqing 2026-08-12 12:58:03 +08:00
parent fca96b5a72
commit bb7e5ef5ac
2 changed files with 230 additions and 83 deletions

View File

@ -36,6 +36,8 @@ PUBLIC_PATHS=(
"/rbac/user/code_login.dspy" "/rbac/user/code_login.dspy"
"/rbac/user/sms_register.dspy" "/rbac/user/sms_register.dspy"
"/rbac/get_user_info.dspy" "/rbac/get_user_info.dspy"
"/rbac/user/user_panel.ui"
"/appbase/menu.ui"
) )
for path in "${PUBLIC_PATHS[@]}"; do for path in "${PUBLIC_PATHS[@]}"; do

View File

@ -1,13 +1,90 @@
{
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"bgcolor": "#f8fafc"
},
"subwidgets": [
{ {
"widgettype": "HBox", "widgettype": "HBox",
"id": "pccs_root", "options": {
"options": {"width": "100%", "height": "100%"}, "width": "100%",
"cheight": 2.5,
"padding": "0 16px",
"alignItems": "center",
"bgcolor": "#ffffff",
"borderBottom": "1px solid #e2e8f0"
},
"subwidgets": [
{
"widgettype": "Button",
"id": "sidebar_toggle_btn",
"options": {
"css": "text",
"label": "☰",
"cfontsize": 1.4,
"color": "#64748b"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "method",
"target": "pccs_sidebar",
"method": "toggle_collapse"
}
]
},
{
"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": "HBox",
"options": {
"css": "filler",
"padding": "0",
"gap": "0"
},
"subwidgets": [ "subwidgets": [
{ {
"widgettype": "VBox", "widgettype": "VBox",
"id": "pccs_sidebar", "id": "pccs_sidebar",
"options": { "options": {
"width": "220px", "width": "220px",
"minWidth": "200px",
"height": "100%", "height": "100%",
"bgcolor": "#0f172a", "bgcolor": "#0f172a",
"padding": "0", "padding": "0",
@ -21,71 +98,137 @@
"borderBottom": "1px solid #1e293b" "borderBottom": "1px solid #1e293b"
}, },
"subwidgets": [ "subwidgets": [
{"widgettype": "Text", "options": { {
"widgettype": "Text",
"options": {
"otext": "PCCS", "otext": "PCCS",
"cfontsize": 1.3, "cfontsize": 1.3,
"fontWeight": "bold", "fontWeight": "bold",
"color": "#e2e8f0" "color": "#e2e8f0"
}}, }
{"widgettype": "Text", "options": { },
{
"widgettype": "Text",
"options": {
"otext": "算力中心集群系统", "otext": "算力中心集群系统",
"cfontsize": 0.75, "cfontsize": 0.75,
"color": "#64748b" "color": "#64748b"
}} }
]
},
{
"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": "VBox", "widgettype": "Menu",
"id": "pccs_main", "id": "pccs_menu",
"options": { "options": {
"css": "filler", "width": "100%",
"bgcolor": "#f8fafc", "height": "100%",
"overflow": "auto" "target": "pccs_main",
}, "items": [
"subwidgets": [
{ {
"widgettype": "VBox", "name": "dashboard",
"id": "dashboard_header", "label": "📊 概览",
"options": { "icon": "",
"bgcolor": "#ffffff", "url": "{{entire_url('/')}}"
"borderBottom": "1px solid #e2e8f0",
"padding": "16px 24px"
}, },
"subwidgets": [ {
{"widgettype": "Text", "options": { "name": "compute_pool",
"otext": "概览", "label": "📦 算力池列表",
"cfontsize": 1.3, "icon": "",
"fontWeight": "bold", "url": "{{entire_url('/pcpool/compute_pool_list/index.ui')}}"
"color": "#1e293b" },
}}, {
{"widgettype": "Text", "options": { "name": "compute_node",
"otext": "算力中心资源总览", "label": "📦 算力节点",
"cfontsize": 0.85, "icon": "",
"color": "#64748b" "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": "VBox", "widgettype": "VScrollPanel",
"id": "dashboard_content", "id": "pccs_main",
"options": {"css": "filler", "padding": "24px", "gap": "20px", "overflow": "auto"}, "options": {
"css": "filler",
"width": "100%",
"height": "100%"
},
"subwidgets": [ "subwidgets": [
{
"widgettype": "VBox",
"options": {
"padding": "32px",
"spacing": "24px"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"otext": "概览",
"cfontsize": 1.5,
"fontWeight": "bold",
"color": "#1e293b"
}
},
{
"widgettype": "Text",
"options": {
"otext": "算力中心资源总览",
"cfontsize": 0.9,
"color": "#64748b"
}
},
{ {
"widgettype": "HBox", "widgettype": "HBox",
"options": {"gap": "16px"}, "options": {"gap": "16px"},
@ -136,3 +279,5 @@
} }
] ]
} }
]
}