Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化workload的状态展示 #666

Merged
merged 4 commits into from
Sep 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 26 additions & 4 deletions src/utils/formatter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,21 @@ const formatterNamespace = (row, column, cellValue) => {
export { formatterNamespace };

const runningFormatter = (row, column, cellValue) => {
const status = '运行中';
let status = '运行中';
let availableReplicas = cellValue.availableReplicas;
if (availableReplicas === undefined) {
availableReplicas = 0;
}
let replicas = row.spec.replicas

if (availableReplicas !== replicas) {
status = "更新中"
} else {
if (replicas === 0 && availableReplicas === 0) {
status = "已停止"
}
}

return (
<div style="display: flex">
<div>
Expand Down Expand Up @@ -527,20 +541,28 @@ const runningStatus = {
name: 'icon-circle-dot',
color: '#28C65A', // 绿色
},
更新中: {
name: 'icon-circle-dot',
color: '#E0992C', // 黄色
},
已停止: {
name: 'icon-circle-dot',
color: '#86929D', // 黑色
},
集群异常: {
name: 'icon-yichang',
color: '#FF0000', // 红色
},
构建中: {
icon: 'icon-dlf-shujuhugoujian',
name: 'icon-dlf-shujuhugoujian',
color: '#0000FF', // 蓝色
},
删除中: {
icon: 'icon-shanchu',
name: 'icon-shanchu',
color: '#FF00FF', // 牡丹红
},
等待构建: {
icon: 'icon-icon-',
name: 'icon-icon-',
color: '#FFFF00', // 黄色
},
};
Expand Down
Loading