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