mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-04 11:52:07 +08:00
[Bugfix]修复集群Topic列表页面白屏问题(#819)
集群Topic列表健康状态对应关系存在问题,导致当健康状态指标存在时,会出现白屏。
This commit is contained in:
@@ -23,3 +23,11 @@ export const getChartConfig = (title: string) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const HealthStateMap: any = {
|
||||||
|
'-1': 'Unknown',
|
||||||
|
0: '好',
|
||||||
|
1: '中',
|
||||||
|
2: '差',
|
||||||
|
3: 'Down',
|
||||||
|
};
|
||||||
|
|||||||
@@ -18,7 +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";
|
import { HealthStateMap } from './config';
|
||||||
|
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
|
|
||||||
@@ -92,8 +92,7 @@ const AutoPage = (props: any) => {
|
|||||||
const orgVal = record?.latestMetrics?.metrics?.[metricName];
|
const orgVal = record?.latestMetrics?.metrics?.[metricName];
|
||||||
if (orgVal !== undefined) {
|
if (orgVal !== undefined) {
|
||||||
if (metricName === 'HealthState') {
|
if (metricName === 'HealthState') {
|
||||||
const val = sliderValueMap[(orgVal) as keyof typeof sliderValueMap];
|
return HealthStateMap[orgVal] || '-';
|
||||||
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 {
|
||||||
@@ -165,8 +164,8 @@ const AutoPage = (props: any) => {
|
|||||||
sorter: true,
|
sorter: true,
|
||||||
// 设计图上量出来的是144,但做的时候发现写144 header部分的sort箭头不出来,所以临时调大些
|
// 设计图上量出来的是144,但做的时候发现写144 header部分的sort箭头不出来,所以临时调大些
|
||||||
width: 170,
|
width: 170,
|
||||||
render: (value: any, record: any) =>{
|
render: (value: any, record: any) => {
|
||||||
return calcCurValue(record, "HealthState")
|
return calcCurValue(record, 'HealthState');
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
|
|||||||
Reference in New Issue
Block a user