This commit is contained in:
孙超
2022-12-15 18:48:41 +08:00
committed by EricZeng
parent 5bceed7105
commit 860d0b92e2
59 changed files with 25972 additions and 1497 deletions

View File

@@ -165,12 +165,28 @@ const ChartDetail = (props: ChartDetailProps) => {
// 请求图表数据
const getMetricChartData = ([startTime, endTime]: readonly [number, number]) => {
return Utils.post(api.getDashboardMetricChartData(clusterId, metricType), {
const getQueryUrl = () => {
switch (metricType) {
case MetricType.Connect: {
return api.getConnectClusterMetrics(clusterId);
}
default: {
return api.getDashboardMetricChartData(clusterId, metricType);
}
}
};
const queryMap = {
[MetricType.Broker]: 'brokerIds',
[MetricType.Topic]: 'topics',
[MetricType.Connect]: 'connectClusterIdList',
[MetricType.Connectors]: 'connectorNameList',
};
return Utils.post(getQueryUrl(), {
startTime,
endTime,
metricsNames: [metricName],
topNu: null,
[metricType === MetricType.Broker ? 'brokerIds' : 'topics']: queryLines,
[queryMap[metricType as keyof typeof queryMap]]: queryLines,
});
};