fix: sidebar uses Tree widget instead of Menu (Tree has built-in nav)

This commit is contained in:
yumoqing 2026-08-12 13:05:17 +08:00
parent 51db747252
commit 334af61639

View File

@ -30,9 +30,9 @@
{ {
"wid": "self", "wid": "self",
"event": "click", "event": "click",
"actiontype": "method", "actiontype": "script",
"target": "pccs_sidebar", "target": "self",
"method": "toggle_collapse" "script": "var s=bricks.getWidgetById('pccs_sidebar',app);if(s){var el=s.dom_element;el.classList.toggle('menu-collapsed');s.resize()}"
} }
] ]
}, },
@ -118,79 +118,56 @@
] ]
}, },
{ {
"widgettype": "Menu", "widgettype": "Text",
"id": "pccs_menu",
"options": { "options": {
"width": "100%", "otext": "主导航",
"height": "100%", "cfontsize": 0.7,
"target": "pccs_main", "color": "#475569",
"items": [ "padding": "4px 4px 8px 4px",
{ "fontWeight": "bold"
"name": "dashboard", }
"label": "📊 概览", },
"icon": "", {
"url": "{{entire_url('/')}}" "widgettype": "Tree",
}, "id": "pccs_menu_tree",
{ "options": {
"name": "compute_pool", "bgcolor": "transparent",
"label": "📦 算力池列表", "color": "#94a3b8",
"icon": "", "color_selected": "#e2e8f0",
"url": "{{entire_url('/pcpool/compute_pool_list/index.ui')}}" "bgcolor_selected": "#1e293b",
}, "fontSize": "0.9rem",
{ "indent": 16,
"name": "compute_node", "data": [
"label": "📦 算力节点", {"id": "dashboard", "label": "📊 概览",
"icon": "", "url": "{{entire_url('/pccs/index.ui')}}"},
"url": "{{entire_url('/pcpool/compute_node_list/index.ui')}}" {"id": "pool", "label": "📦 算力池管理", "children": [
}, {"id": "pool_list", "label": "算力池列表",
{ "url": "{{entire_url('/pcpool/compute_pool_list/index.ui')}}"},
"name": "cluster_list", {"id": "node_list", "label": "算力节点列表",
"label": "🖥 集群列表", "url": "{{entire_url('/pcpool/compute_node_list/index.ui')}}"}
"icon": "", ]},
"url": "{{entire_url('/pcc/cluster_list/index.ui')}}" {"id": "cluster", "label": "🖥 集群管理", "children": [
}, {"id": "cluster_list", "label": "集群列表",
{ "url": "{{entire_url('/pcc/cluster_list/index.ui')}}"},
"name": "cluster_node", {"id": "cn_list", "label": "节点分配",
"label": "🖥 节点分配", "url": "{{entire_url('/pcc/cluster_node_list/index.ui')}}"}
"icon": "", ]},
"url": "{{entire_url('/pcc/cluster_node_list/index.ui')}}" {"id": "storage", "label": "💾 存储管理", "children": [
}, {"id": "storage_server", "label": "存储服务器",
{ "url": "{{entire_url('/storage_mgr/storage_server_list/index.ui')}}"},
"name": "storage_server", {"id": "storage_export", "label": "存储导出",
"label": "💾 存储服务器", "url": "{{entire_url('/storage_mgr/storage_export_list/index.ui')}}"},
"icon": "", {"id": "storage_mount", "label": "存储挂载",
"url": "{{entire_url('/storage_mgr/storage_server_list/index.ui')}}" "url": "{{entire_url('/storage_mgr/storage_mount_list/index.ui')}}"}
}, ]},
{ {"id": "image", "label": "🏗 镜像管理", "children": [
"name": "storage_export", {"id": "mirror_source", "label": "镜像源配置",
"label": "💾 存储导出", "url": "{{entire_url('/image_mgr/mirror_source_list/index.ui')}}"},
"icon": "", {"id": "image_registry", "label": "镜像仓库",
"url": "{{entire_url('/storage_mgr/storage_export_list/index.ui')}}" "url": "{{entire_url('/image_mgr/image_registry_list/index.ui')}}"},
}, {"id": "container_image", "label": "容器镜像",
{ "url": "{{entire_url('/image_mgr/container_image_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')}}"
}
] ]
} }
} }