[Feat]Topic列表健康分修改为健康状态(#758)

This commit is contained in:
duanxiaoqiu
2022-11-17 16:45:23 +08:00
committed by 早晚会起风
parent 636c2c6a83
commit 2f807eec2b

View File

@@ -18,6 +18,7 @@ import ReplicaMove from '@src/components/TopicJob/ReplicaMove';
import { formatAssignSize } from '../Jobs/config';
import { DownOutlined } from '@ant-design/icons';
import { tableHeaderPrefix } from '@src/constants/common';
import {sliderValueMap} from "@src/pages/MutliClusterPage/config";
const { Option } = Select;
@@ -90,8 +91,9 @@ const AutoPage = (props: any) => {
// return item?.value || '';
const orgVal = record?.latestMetrics?.metrics?.[metricName];
if (orgVal !== undefined) {
if (metricName === 'HealthScore') {
return Math.round(orgVal).toLocaleString();
if (metricName === 'HealthState') {
const val = sliderValueMap[(orgVal) as keyof typeof sliderValueMap];
return val.name;
} else if (metricName === 'LogSize') {
return Number(Utils.formatAssignSize(orgVal, 'MB')).toLocaleString();
} else {
@@ -157,13 +159,15 @@ const AutoPage = (props: any) => {
width: 95,
},
{
title: '健康',
dataIndex: 'HealthScore',
key: 'HealthScore',
title: '健康状态',
dataIndex: 'HealthState',
key: 'HealthState',
sorter: true,
// 设计图上量出来的是144但做的时候发现写144 header部分的sort箭头不出来所以临时调大些
width: 170,
render: (value: any, record: any) => renderLine(record, 'HealthScore'),
render: (value: any, record: any) =>{
return calcCurValue(record, "HealthState")
},
},
// {
// title: '创建时间',