diff --git a/frontend/components.d.ts b/frontend/components.d.ts index aca2463..68b55ea 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -26,6 +26,7 @@ declare module 'vue' { ElSlider: typeof import('element-plus/es')['ElSlider'] ElTable: typeof import('element-plus/es')['ElTable'] ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] + ElTag: typeof import('element-plus/es')['ElTag'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] SubsystemCard: typeof import('./src/components/SubsystemCard.vue')['default'] diff --git a/frontend/src/views/dashboard/Index.vue b/frontend/src/views/dashboard/Index.vue index 5a14ed9..b2f3de6 100644 --- a/frontend/src/views/dashboard/Index.vue +++ b/frontend/src/views/dashboard/Index.vue @@ -3,49 +3,54 @@

资源大盘

-

跨机房 / 多云容器资源统一视图 · 最近更新于 12 秒前

+

{{ currentBusinessLineName }} 业务线资源视图 · {{ lastUpdatedText }}

- ⟳ 刷新 + 刷新 +
+ +
+ 部分数据未同步 + {{ loadErrors.join(';') }}
RKE2 集群
-
{{ profile.clusters }}
-
{{ profile.clusters }} 机房在线
+
{{ containerSummary.clusters }}
+
{{ containerSummary.readyNodes }} / {{ containerSummary.nodes }} Ready 节点
-
节点总数
-
{{ profile.nodes }}
-
↑ {{ Math.max(1, Math.round(profile.nodes / 24)) }} 本周新增
+
容器节点
+
{{ containerSummary.nodes }}
+
{{ containerSummary.schedulableNodes }} 个可调度
-
CPU 已分配
-
{{ profile.cpuAllocated }}%
-
{{ Math.round(profile.nodes * 16 * profile.cpuAllocated / 100) }} / {{ profile.nodes * 16 }} 核
+
纳管机器
+
{{ machineOverview.total }}
+
物理机 {{ machineOverview.physical }} · 虚机 {{ machineOverview.virtual }}
-
组件实例
-
{{ profile.components }}
-
MySQL {{ profile.mysql }} · Redis {{ profile.redis }} · 其他 {{ profile.components - profile.mysql - profile.redis }}
+
服务实例
+
{{ serviceInstanceCount }}
+
MySQL {{ mysqlInstanceCount }} · 容器工作负载 {{ containerSummary.workloads }}
-
进行中任务
-
{{ profile.tasksRunning }}
-
{{ Math.min(profile.tasksRunning, 1) }} 个待关注
+
进行中交付
+
{{ activeTasks.length }}
+
MySQL 自动交付任务
-
+
-

容器化服务 · 资源概览

- {{ containerLoading ? '同步中...' : containerMetaText }} +

容器资源

+ Wayne / Kubernetes 实时汇总
命名空间 {{ containerSummary.namespaces }} - {{ currentName }} 业务线绑定 + 当前业务线绑定
工作负载 @@ -57,263 +62,581 @@ {{ containerSummary.pods }} {{ containerSummary.readyPods }} ready
-
- CPU 已用 - {{ formatMetric(containerSummary.cpuUsed) }}C - {{ containerSummary.cpuPercent }}% of allocatable +
+
+ CPU 已用 + {{ normalizePercent(containerSummary.cpuPercent) }}% +
+
+ +
+ {{ formatMetric(containerSummary.cpuUsed) }} / {{ formatMetric(containerSummary.cpuTotal) }} 核
-
- Memory 已用 - {{ formatMetric(containerSummary.memoryUsed) }}G - {{ containerSummary.memoryPercent }}% of allocatable +
+
+ 内存已用 + {{ normalizePercent(containerSummary.memoryPercent) }}% +
+
+ +
+ {{ formatMetric(containerSummary.memoryUsed) }} / {{ formatMetric(containerSummary.memoryTotal) }} GiB
-
+
-
-
+
+
-

集群拓扑 · 按机房 / 业务线标签

- node-label 调度视图 +

机器资源分布

+ 查看机器详情
-
-
-
- {{ profile.primaryZone }} - {{ Math.round(profile.nodes * 0.42) }}节点 +
+
当前业务线暂无机器数据
+
+
+
+ {{ group.location }} +
+ {{ group.items.length }} 台
-
-
+
+
+
+ +{{ hiddenMachineCount(group.items) }} +
-
-
-
- {{ profile.secondaryZone }} - {{ Math.round(profile.nodes * 0.36) }}节点 -
-
-
-
-
-
-
- 弹性云资源池 - {{ Math.max(1, profile.nodes - Math.round(profile.nodes * 0.42) - Math.round(profile.nodes * 0.36)) }}节点 -
-
-
+
+ 物理机 {{ group.physical }} + 虚机 {{ group.virtual }}
-
- {{ currentName }}主资源池 - {{ currentName }}扩展池 - {{ currentName }}弹性池 - 空闲 +
+ 物理机 + 虚机 + 异常
-
+
-
+

最近任务

- 查看全部 → + 查看全部
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
● 成功{{ profile.servicePrefix }} MySQL 主从部署2m14s
● 执行中{{ profile.servicePrefix }} RKE2 节点加入38s
● 成功{{ profile.servicePrefix }} Redis Cluster 部署3m02s
● 失败{{ profile.servicePrefix }} openresty 网关部署41s
● 成功业务线标签同步5s
+
+
当前业务线暂无任务记录
+ + ● {{ task.status_text }} + + {{ task.name }} + {{ task.runner }} + + +
-
+
diff --git a/frontend/src/views/resource/Tenants.vue b/frontend/src/views/resource/Tenants.vue index 045326d..a6afb94 100644 --- a/frontend/src/views/resource/Tenants.vue +++ b/frontend/src/views/resource/Tenants.vue @@ -3,138 +3,456 @@

业务配额

-

按业务线划分资源配额与隔离策略 · RBAC 权限随业务线自动具备

+

{{ currentBusinessLineName }} 的容器资源使用与命名空间隔离范围

+
+
+ 刷新 + + 配置命名空间 +
- + 新增业务线
-
+
{{ error }}
+ +
-

业务线列表

- 按业务线隔离命名空间、节点标签与配额 +
+

资源概览

+ Wayne 集群实时汇总 +
+ 配额上限未接入
-
+ +
+
+
+ 命名空间 + {{ namespaces.length }} +
+
+ 集群 + {{ summary.clusters }} +
+
+ Ready 节点 + {{ summary.readyNodes }}/ {{ summary.nodes }} +
+
+ 工作负载 + {{ summary.workloads }} +
+
+ Pod + {{ summary.readyPods }}/ {{ summary.pods }} +
+
+ +
+
+
+
+ CPU 使用 + {{ formatAmount(summary.cpuUsed) }} / {{ formatAmount(summary.cpuTotal) }} 核 +
+ {{ normalizePercent(summary.cpuPercent) }}% +
+
+ +
+
+ +
+
+
+ 内存使用 + {{ formatAmount(summary.memoryUsed) }} / {{ formatAmount(summary.memoryTotal) }} GiB +
+ {{ normalizePercent(summary.memoryPercent) }}% +
+
+ +
+
+
+ +
+ 部分数据未同步 + {{ summary.errors.join(';') }} +
+
+
+ +
+
+
+

命名空间与隔离范围

+ 当前业务线已绑定的 Wayne namespace +
+ {{ namespaces.length }} 个绑定 +
+
+ + - - - - - + - - - - - - - - - - + + + + + + + + +
Wayne namespaceKubernetes namespace 业务线标识命名空间节点数CPU 配额内存配额访问角色 状态
{{ tenant.name }}{{ tenant.key }}{{ tenant.namespace }}{{ tenant.nodes }} - - - - {{ tenant.cpuPct }}% - - - - - {{ tenant.memPct }}% - ● {{ tenant.status }} - 详情 -
当前业务线尚未绑定 Wayne namespace
{{ namespace.name || '-' }}{{ namespace.kubeNamespace || '-' }}{{ currentBusinessLineName }}{{ businessLineStore.current?.role || '-' }}● 已绑定
-
- -
- 配额与隔离策略:每个业务线绑定独立的 K8s namespace 与 node-label,资源配额通过 ResourceQuota 限制 CPU / 内存上限。 - RBAC 角色(viewer / operator / admin)随业务线自动具备,子系统(Wayne / CloudDM)凭 SSO 身份免登进入。 -
+
+
+ 资源边界 + Kubernetes namespace +
+
+ 节点隔离 + business-line node-label +
+
+ 身份访问 + 业务线 RBAC +
+
+
diff --git a/frontend/src/views/subsystem/SubsystemDetail.vue b/frontend/src/views/subsystem/SubsystemDetail.vue index ed4d4f4..853fa0a 100644 --- a/frontend/src/views/subsystem/SubsystemDetail.vue +++ b/frontend/src/views/subsystem/SubsystemDetail.vue @@ -1,82 +1,110 @@