mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-13 00:08:56 +00:00
refactor: update
This commit is contained in:
parent
980f8fa650
commit
0db3c06770
@ -114,10 +114,10 @@ export function useExpressionsSourceProcessor(
|
||||
}
|
||||
const source: { [key: string]: unknown } = {};
|
||||
const keys = Object.keys(resp.data);
|
||||
|
||||
config.metricTypes.forEach((type: string, index) => {
|
||||
const c = (config.metricConfig && config.metricConfig[index]) || {};
|
||||
const results = (resp.data[keys[index]] && resp.data[keys[index]].results) || [];
|
||||
for (let i = 0; i < config.metricTypes.length; i++) {
|
||||
const type = config.metricTypes[i];
|
||||
const c = (config.metricConfig && config.metricConfig[i]) || {};
|
||||
const results = (resp.data[keys[i]] && resp.data[keys[i]].results) || [];
|
||||
const name = ((results[0] || {}).metric || {}).name;
|
||||
|
||||
if (type === ExpressionResultType.TIME_SERIES_VALUES) {
|
||||
@ -131,7 +131,7 @@ export function useExpressionsSourceProcessor(
|
||||
if (([ExpressionResultType.RECORD_LIST, ExpressionResultType.SORTED_LIST] as string[]).includes(type)) {
|
||||
source[name] = results[0].values;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return source;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user