mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-11 10:22:13 +08:00
V3.2
This commit is contained in:
@@ -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,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user