feat: menu/i18n/CRUD/permission/stats/model fixes

This commit is contained in:
pccs 2026-08-12 19:35:32 +08:00
parent 334af61639
commit a0ea121602
9 changed files with 394 additions and 321 deletions

19
i18n/en/msg.txt Normal file
View File

@ -0,0 +1,19 @@
存储导出: Storage Export
存储挂载: Storage Mount
存储服务器: Storage Server
存储管理: Storage Management
容器镜像: Container Image
算力池列表: Compute Pool List
算力池管理: Compute Pool Management
算力节点列表: Compute Node List
节点分配: Node Assignment
镜像仓库: Image Registry
镜像源配置: Mirror Source Config
镜像管理: Image Management
集群列表: Cluster List
集群管理: Cluster Management
🏗 镜像管理:
💾 存储管理:
📊 概览:
📦 算力池管理:
🖥 集群管理:

19
i18n/zh/msg.txt Normal file
View File

@ -0,0 +1,19 @@
存储导出: 存储导出
存储挂载: 存储挂载
存储服务器: 存储服务器
存储管理: 存储管理
容器镜像: 容器镜像
算力池列表: 算力池列表
算力池管理: 算力池管理
算力节点列表: 算力节点列表
节点分配: 节点分配
镜像仓库: 镜像仓库
镜像源配置: 镜像源配置
镜像管理: 镜像管理
集群列表: 集群列表
集群管理: 集群管理
🏗 镜像管理: 🏗 镜像管理
💾 存储管理: 💾 存储管理
📊 概览: 📊 概览
📦 算力池管理: 📦 算力池管理
🖥 集群管理: 🖥 集群管理

22
wwwroot/bottom.ui Normal file
View File

@ -0,0 +1,22 @@
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "32px",
"bgcolor": "#f8fafc",
"borderTop": "1px solid #e2e8f0",
"padding": "0 16px",
"halign": "center",
"valign": "center"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"otext": "© 2026 PCCS 算力中心集群系统 | ICP备案号粤ICP备XXXXXXXX号",
"cfontsize": 0.7,
"color": "#94a3b8"
}
}
]
}

36
wwwroot/i18n/language.ui Normal file
View File

@ -0,0 +1,36 @@
{
"id":"language",
"widgettype":"Text",
"options":{
"tip":"change UI language",
"i18n":true,
"otext":"{{params_kw._lang}}",
"cwidth": 4,
"css":"clickable"
},
"binds":[
{
"wid":"self",
"event":"click",
"actiontype":"urlwidget",
"target":"Popup",
"popup_options":{
"eventpos":true,
"cwidth": 11,
"cheight":10,
"dismiss_events":["command"]
},
"options":{
"url":"{{entire_url('menu.ui')}}"
}
},
{
"wid":"app",
"event":"lang",
"actiontype":"script",
"target":"self",
"script":"this.set_otext(bricks.app.lang)"
}
]
}

20
wwwroot/i18n/menu.ui Normal file
View File

@ -0,0 +1,20 @@
{
"id": "lang_menu",
"widgettype": "Menu",
"options": {
"width": "160px",
"items": [
{"name": "zh", "label": "中文"},
{"name": "en", "label": "English"}
]
},
"binds": [
{
"wid": "self",
"event": "menuitem_clicked",
"actiontype": "script",
"target": "self",
"script": "var item=bricks.app.last_menuitem_data; if(item&&item.name){bricks.app.set_lang(item.name); bricks.app.fire('lang', item.name)}"
}
]
}

View File

@ -1,69 +1,2 @@
<!DOCTYPE html>
<html lang="zh-CN" data-theme="light">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1.0"><title>PCCS 算力中心集群系统</title>
<style>
:root,[data-theme="light"]{--bg:#f8fafc;--card-bg:#fff;--text:#1e293b;--text2:#64748b;--text3:#94a3b8;--border:#e2e8f0;--header-bg:#fff;--sidebar-bg:#0f172a;--sidebar-text:#94a3b8;--sidebar-hover:#1e293b;--sidebar-active:#e2e8f0;--primary:#2563eb;--primary-light:#dbeafe}
[data-theme="dark"]{--bg:#0f172a;--card-bg:#1e293b;--text:#e2e8f0;--text2:#94a3b8;--text3:#64748b;--border:#334155;--header-bg:#1e293b;--sidebar-bg:#020617;--sidebar-text:#64748b;--sidebar-hover:#1e293b;--sidebar-active:#e2e8f0;--primary:#3b82f6;--primary-light:#1e3a5f}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:system-ui;background:var(--bg);color:var(--text);min-height:100vh;display:flex;flex-direction:column}
.header{background:var(--header-bg);border-bottom:1px solid var(--border);padding:0 24px;height:48px;display:flex;align-items:center;flex-shrink:0}
.header .brand{display:flex;align-items:center;gap:10px}
.header .brand .logo{font-size:1.2rem;font-weight:700;color:var(--text)}
.header .brand .sub{font-size:.8rem;color:var(--text3)}
.header .spacer{flex:1}
.header .ctl{display:flex;align-items:center;gap:8px}
.header .ctl button{background:var(--card-bg);border:1px solid var(--border);border-radius:6px;padding:4px 10px;font-size:.8rem;cursor:pointer;color:var(--text2)}
.header .ctl button:hover{background:var(--primary-light)}
.main{display:flex;flex:1;overflow:hidden}
.sidebar{width:220px;background:var(--sidebar-bg);flex-shrink:0;overflow:auto;padding:16px 0}
.sidebar .nav-title{font-size:.7rem;color:#475569;padding:4px 16px 8px;font-weight:700}
.sidebar a{display:block;padding:8px 16px;color:var(--sidebar-text);text-decoration:none;font-size:.9rem}
.sidebar a:hover{color:var(--sidebar-active);background:var(--sidebar-hover)}
.content{flex:1;overflow:auto;padding:24px;display:grid;grid-template-columns:repeat(auto-fit,minmax(280px,1fr));gap:16px;align-content:start}
.card{background:var(--card-bg);border:1px solid var(--border);border-radius:8px;padding:20px}
.card h3{margin:0 0 8px;font-size:1rem}
.card p{margin:0 0 12px;font-size:.85rem;color:var(--text2)}
.card a{color:var(--primary);text-decoration:none;font-weight:600;display:inline-block;margin-right:16px}
.footer{text-align:center;padding:12px;font-size:.75rem;color:var(--text3);border-top:1px solid var(--border)}
</style></head>
<body>
<div class="header">
<div class="brand"><span class="logo">PCCS</span><span class="sub">算力中心集群系统</span></div>
<div class="spacer"></div>
<div class="ctl">
<button onclick="toggleTheme()" id="btn-theme">🌓</button>
<button id="btn-lang">🌐 中文</button>
<button id="btn-login" onclick="location.href='/rbac/user/login.ui'">👤 登录</button>
</div>
</div>
<div class="main">
<div class="sidebar">
<div class="nav-title">主导航</div>
<a href="/">📊 概览</a>
<a href="/pcpool/compute_pool_list/index.ui">📦 算力池列表</a>
<a href="/pcpool/compute_node_list/index.ui">📦 算力节点</a>
<a href="/pcc/cluster_list/index.ui">🖥 集群列表</a>
<a href="/pcc/cluster_node_list/index.ui">🖥 节点分配</a>
<a href="/storage_mgr/storage_server_list/index.ui">💾 存储服务器</a>
<a href="/storage_mgr/storage_export_list/index.ui">💾 存储导出</a>
<a href="/storage_mgr/storage_mount_list/index.ui">💾 存储挂载</a>
<a href="/image_mgr/mirror_source_list/index.ui">🏗 镜像源</a>
<a href="/image_mgr/image_registry_list/index.ui">🏗 镜像仓库</a>
<a href="/image_mgr/container_image_list/index.ui">🏗 容器镜像</a>
</div>
<div class="content">
<div class="card"><h3>📦 算力池管理</h3><p>节点池创建、节点注册、资源分配、心跳监控</p><a href="/pcpool/compute_pool_list/index.ui">算力池列表 →</a><a href="/pcpool/compute_node_list/index.ui">节点列表 →</a></div>
<div class="card"><h3>🖥 集群管理</h3><p>K8s/Slurm/Ray 集群部署、节点增减、状态监控</p><a href="/pcc/cluster_list/index.ui">集群列表 →</a><a href="/pcc/cluster_node_list/index.ui">节点分配 →</a></div>
<div class="card"><h3>💾 存储管理</h3><p>NFS 共享存储服务器、导出路径、节点挂载</p><a href="/storage_mgr/storage_server_list/index.ui">服务器 →</a><a href="/storage_mgr/storage_export_list/index.ui">导出 →</a><a href="/storage_mgr/storage_mount_list/index.ui">挂载 →</a></div>
<div class="card"><h3>🏗 镜像管理</h3><p>国内镜像源、本地仓库部署、镜像导入/同步</p><a href="/image_mgr/mirror_source_list/index.ui">镜像源 →</a><a href="/image_mgr/image_registry_list/index.ui">仓库 →</a><a href="/image_mgr/container_image_list/index.ui">镜像 →</a></div>
</div>
</div>
<div class="footer">pccs v0.1 · pccs.opencomputing.cn:9180</div>
<script>
var theme=localStorage.getItem('pccs-theme')||'light';
document.documentElement.setAttribute('data-theme',theme);
function toggleTheme(){theme=theme==='light'?'dark':'light';document.documentElement.setAttribute('data-theme',theme);localStorage.setItem('pccs-theme',theme)}
</script>
</body>
</html>
<html><head><meta http-equiv="refresh" content="0;url=/index.ui"></head><body></body></html>

View File

@ -2,48 +2,35 @@
"widgettype": "VBox",
"options": {
"width": "100%",
"height": "100%",
"bgcolor": "#f8fafc"
"height": "100%"
},
"subwidgets": [
{
"widgettype": "HBox",
"options": {
"height": "48px",
"width": "100%",
"cheight": 2.5,
"padding": "0 16px",
"alignItems": "center",
"bgcolor": "#ffffff",
"borderBottom": "1px solid #e2e8f0"
"borderBottom": "1px solid #e2e8f0",
"padding": "0 16px",
"halign": "space-between",
"valign": "center"
},
"subwidgets": [
{
"widgettype": "Button",
"id": "sidebar_toggle_btn",
"widgettype": "HBox",
"options": {
"css": "text",
"label": "☰",
"cfontsize": 1.4,
"color": "#64748b"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "self",
"script": "var s=bricks.getWidgetById('pccs_sidebar',app);if(s){var el=s.dom_element;el.classList.toggle('menu-collapsed');s.resize()}"
}
]
"spacing": "8px",
"valign": "center"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"otext": "PCCS",
"cfontsize": 1.2,
"fontWeight": "bold",
"color": "#1e293b",
"padding": "0 8px"
"color": "#1e293b"
}
},
{
@ -53,10 +40,31 @@
"cfontsize": 0.8,
"color": "#94a3b8"
}
}
]
},
{
"widgettype": "Filler"
},
{
"widgettype": "Button",
"id": "theme_toggle_btn",
"options": {
"label": "🌓",
"width": "36px",
"height": "36px",
"padding": "0"
},
"binds": [
{
"wid": "self",
"event": "click",
"actiontype": "script",
"target": "app",
"script": "var h=document.documentElement;var t=h.getAttribute('data-theme')||'light';var n=t=='light'?'dark':'light';h.setAttribute('data-theme',n);localStorage.setItem('pccs-theme',n);var b=bricks.getWidgetById('theme_toggle_btn',bricks.app);if(b){b.opts.label=n=='light'?'🌙':'☀️';b.dom_element.textContent=b.opts.label}"
}
]
},
{
"widgettype": "urlwidget",
"options": {
@ -75,8 +83,7 @@
"widgettype": "HBox",
"options": {
"css": "filler",
"padding": "0",
"gap": "0"
"width": "100%"
},
"subwidgets": [
{
@ -87,87 +94,100 @@
"minWidth": "200px",
"height": "100%",
"bgcolor": "#0f172a",
"padding": "0",
"flexShrink": "0"
"padding": "16px 0"
},
"subwidgets": [
{
"widgettype": "VBox",
"widgettype": "Menu",
"id": "pccs_menu",
"options": {
"padding": "20px 16px",
"borderBottom": "1px solid #1e293b"
},
"subwidgets": [
"width": "100%",
"height": "100%",
"menuitem_css": "menuitem",
"items": [
{
"widgettype": "Text",
"options": {
"otext": "PCCS",
"cfontsize": 1.3,
"fontWeight": "bold",
"color": "#e2e8f0"
}
"name": "dashboard",
"label": "📊 概览",
"icon": "",
"url": "{{entire_url('/pccs/overview.ui')}}",
"target": "app.pccs_main_content"
},
{
"widgettype": "Text",
"options": {
"otext": "算力中心集群系统",
"cfontsize": 0.75,
"color": "#64748b"
}
"name": "pool",
"label": "📦 算力池管理",
"icon": "",
"items": [
{
"name": "pool_list",
"label": "算力池列表",
"url": "{{entire_url('/pcpool/compute_pool_list/index.ui')}}",
"target": "app.pccs_main_content"
}
]
},
{
"widgettype": "Text",
"options": {
"otext": "主导航",
"cfontsize": 0.7,
"color": "#475569",
"padding": "4px 4px 8px 4px",
"fontWeight": "bold"
"name": "cluster",
"label": "🖥 集群管理",
"icon": "",
"items": [
{
"name": "cluster_list",
"label": "集群列表",
"url": "{{entire_url('/pcc/cluster_list/index.ui')}}",
"target": "app.pccs_main_content"
}
]
},
{
"widgettype": "Tree",
"id": "pccs_menu_tree",
"options": {
"bgcolor": "transparent",
"color": "#94a3b8",
"color_selected": "#e2e8f0",
"bgcolor_selected": "#1e293b",
"fontSize": "0.9rem",
"indent": 16,
"data": [
{"id": "dashboard", "label": "📊 概览",
"url": "{{entire_url('/pccs/index.ui')}}"},
{"id": "pool", "label": "📦 算力池管理", "children": [
{"id": "pool_list", "label": "算力池列表",
"url": "{{entire_url('/pcpool/compute_pool_list/index.ui')}}"},
{"id": "node_list", "label": "算力节点列表",
"url": "{{entire_url('/pcpool/compute_node_list/index.ui')}}"}
]},
{"id": "cluster", "label": "🖥 集群管理", "children": [
{"id": "cluster_list", "label": "集群列表",
"url": "{{entire_url('/pcc/cluster_list/index.ui')}}"},
{"id": "cn_list", "label": "节点分配",
"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')}}"},
{"id": "storage_export", "label": "存储导出",
"url": "{{entire_url('/storage_mgr/storage_export_list/index.ui')}}"},
{"id": "storage_mount", "label": "存储挂载",
"url": "{{entire_url('/storage_mgr/storage_mount_list/index.ui')}}"}
]},
{"id": "image", "label": "🏗 镜像管理", "children": [
{"id": "mirror_source", "label": "镜像源配置",
"url": "{{entire_url('/image_mgr/mirror_source_list/index.ui')}}"},
{"id": "image_registry", "label": "镜像仓库",
"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",
"label": "💾 存储管理",
"icon": "",
"items": [
{
"name": "storage_server",
"label": "存储服务器",
"url": "{{entire_url('/storage_mgr/storage_server_list/index.ui')}}",
"target": "app.pccs_main_content"
},
{
"name": "storage_export",
"label": "存储导出",
"url": "{{entire_url('/storage_mgr/storage_export_list/index.ui')}}",
"target": "app.pccs_main_content"
},
{
"name": "storage_mount",
"label": "存储挂载",
"url": "{{entire_url('/storage_mgr/storage_mount_list/index.ui')}}",
"target": "app.pccs_main_content"
}
]
},
{
"name": "image",
"label": "🏗 镜像管理",
"icon": "",
"items": [
{
"name": "mirror_source",
"label": "镜像源配置",
"url": "{{entire_url('/image_mgr/mirror_source_list/index.ui')}}",
"target": "app.pccs_main_content"
},
{
"name": "image_registry",
"label": "镜像仓库",
"url": "{{entire_url('/image_mgr/image_registry_list/index.ui')}}",
"target": "app.pccs_main_content"
},
{
"name": "container_image",
"label": "容器镜像",
"url": "{{entire_url('/image_mgr/container_image_list/index.ui')}}",
"target": "app.pccs_main_content"
}
]
}
]
}
}
@ -175,7 +195,6 @@
},
{
"widgettype": "VScrollPanel",
"id": "pccs_main",
"options": {
"css": "filler",
"width": "100%",
@ -183,76 +202,37 @@
},
"subwidgets": [
{
"widgettype": "VBox",
"widgettype": "urlwidget",
"options": {
"padding": "32px",
"spacing": "24px"
"url": "{{entire_url('/pccs/overview.ui')}}",
"width": "100%",
"height": "100%"
}
},
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "32px",
"bgcolor": "#f8fafc",
"borderTop": "1px solid #e2e8f0",
"padding": "0 16px",
"halign": "center",
"valign": "center"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"otext": "概览",
"cfontsize": 1.5,
"fontWeight": "bold",
"color": "#1e293b"
}
},
{
"widgettype": "Text",
"options": {
"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"
"otext": "© 2026 PCCS 算力中心集群系统 | ICP备案号粤ICP备XXXXXXXX号",
"cfontsize": 0.7,
"color": "#94a3b8"
}
}
]
}
]
}
]
],
"id": "pccs_main_content"
}
]
}

22
wwwroot/overview.ui Normal file
View File

@ -0,0 +1,22 @@
{
"widgettype": "VBox",
"options": {"padding": "24px", "spacing": "24px", "bgcolor": "#f8fafc"},
"subwidgets": [
{"widgettype": "Text", "options": {"otext": "资源概览", "cfontsize": 1.3, "fontWeight": "bold", "color": "#1e293b", "marginBottom": "4px"}},
{"widgettype": "Text", "options": {"otext": "算力池", "cfontsize": 0.9, "fontWeight": "bold", "color": "#64748b", "marginTop": "8px"}},
{"widgettype": "urlwidget", "options": {"url": "{{entire_url('/pcpool/api/pool_stats.dspy')}}", "width": "100%", "height": "100px"}},
{"widgettype": "Text", "options": {"otext": "集群", "cfontsize": 0.9, "fontWeight": "bold", "color": "#64748b", "marginTop": "8px"}},
{"widgettype": "urlwidget", "options": {"url": "{{entire_url('/pcc/api/cluster_status_all.dspy')}}", "width": "100%", "height": "100px"}},
{"widgettype": "Text", "options": {"otext": "存储与镜像", "cfontsize": 0.9, "fontWeight": "bold", "color": "#64748b", "marginTop": "8px"}},
{"widgettype": "HBox", "options": {"gap": "16px"}, "subwidgets": [
{"widgettype": "urlwidget", "options": {"url": "{{entire_url('/storage_mgr/api/storage_stats.dspy')}}", "width": "50%", "height": "60px"}},
{"widgettype": "urlwidget", "options": {"url": "{{entire_url('/image_mgr/api/image_stats.dspy')}}", "width": "50%", "height": "60px"}}
]},
{"widgettype": "Filler"},
{
"widgettype": "HBox",
"options": {"width": "100%", "height": "32px", "bgcolor": "#f8fafc", "borderTop": "1px solid #e2e8f0", "padding": "0 16px", "halign": "center", "valign": "center"},
"subwidgets": [{"widgettype": "Text", "options": {"otext": "(c) 2026 PCCS | ICP(Beian): YueICPBei-XXXXXXXX", "cfontsize": 0.7, "color": "#94a3b8"}}]
}
]
}

22
wwwroot/pccs/bottom.ui Normal file
View File

@ -0,0 +1,22 @@
{
"widgettype": "HBox",
"options": {
"width": "100%",
"height": "32px",
"bgcolor": "#f8fafc",
"borderTop": "1px solid #e2e8f0",
"padding": "0 16px",
"halign": "center",
"valign": "center"
},
"subwidgets": [
{
"widgettype": "Text",
"options": {
"otext": "© 2026 PCCS 算力中心集群系统 | ICP备案号粤ICP备XXXXXXXX号",
"cfontsize": 0.7,
"color": "#94a3b8"
}
}
]
}