mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-06-29 11:07:36 +00:00
Fix the Table widget (#389)
This commit is contained in:
parent
12cd279c90
commit
7f6e4d09c0
@ -112,22 +112,7 @@ export async function useExpressionsQueryProcessor(config: Indexable) {
|
|||||||
tips.push(obj.error);
|
tips.push(obj.error);
|
||||||
typesOfMQE.push(type);
|
typesOfMQE.push(type);
|
||||||
if (!obj.error) {
|
if (!obj.error) {
|
||||||
if (type === ExpressionResultType.TIME_SERIES_VALUES) {
|
if ([ExpressionResultType.SINGLE_VALUE, ExpressionResultType.TIME_SERIES_VALUES].includes(type)) {
|
||||||
if (results.length === 1) {
|
|
||||||
const label = results[0].metric && results[0].metric.labels[0] && results[0].metric.labels[0].value;
|
|
||||||
source[c.label || label || name] = results[0].values.map((d: { value: unknown }) => d.value) || [];
|
|
||||||
} else {
|
|
||||||
for (const item of results) {
|
|
||||||
const values = item.values.map((d: { value: unknown }) => d.value) || [];
|
|
||||||
const label = item.metric.labels
|
|
||||||
.map((d: { key: string; value: string }) => `${d.key}=${d.value}`)
|
|
||||||
.join(",");
|
|
||||||
|
|
||||||
source[label] = values;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (type === ExpressionResultType.SINGLE_VALUE) {
|
|
||||||
for (const item of results) {
|
for (const item of results) {
|
||||||
const label =
|
const label =
|
||||||
item.metric &&
|
item.metric &&
|
||||||
|
Loading…
Reference in New Issue
Block a user