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 source: { [key: string]: unknown } = {};
|
||||||
const keys = Object.keys(resp.data);
|
const keys = Object.keys(resp.data);
|
||||||
|
for (let i = 0; i < config.metricTypes.length; i++) {
|
||||||
config.metricTypes.forEach((type: string, index) => {
|
const type = config.metricTypes[i];
|
||||||
const c = (config.metricConfig && config.metricConfig[index]) || {};
|
const c = (config.metricConfig && config.metricConfig[i]) || {};
|
||||||
const results = (resp.data[keys[index]] && resp.data[keys[index]].results) || [];
|
const results = (resp.data[keys[i]] && resp.data[keys[i]].results) || [];
|
||||||
const name = ((results[0] || {}).metric || {}).name;
|
const name = ((results[0] || {}).metric || {}).name;
|
||||||
|
|
||||||
if (type === ExpressionResultType.TIME_SERIES_VALUES) {
|
if (type === ExpressionResultType.TIME_SERIES_VALUES) {
|
||||||
@ -131,7 +131,7 @@ export function useExpressionsSourceProcessor(
|
|||||||
if (([ExpressionResultType.RECORD_LIST, ExpressionResultType.SORTED_LIST] as string[]).includes(type)) {
|
if (([ExpressionResultType.RECORD_LIST, ExpressionResultType.SORTED_LIST] as string[]).includes(type)) {
|
||||||
source[name] = results[0].values;
|
source[name] = results[0].values;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user