mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-10-14 20:01:28 +00:00
feat: support the SINGLE_VALUE
for table widgets (#383)
This commit is contained in:
@@ -119,14 +119,26 @@ export async function useExpressionsQueryProcessor(config: Indexable) {
|
||||
} else {
|
||||
for (const item of results) {
|
||||
const values = item.values.map((d: { value: unknown }) => d.value) || [];
|
||||
const label = item.metric.labels.map((d: any) => `${d.key}=${d.value}`).join(",");
|
||||
const label = item.metric.labels
|
||||
.map((d: { key: string; value: string }) => `${d.key}=${d.value}`)
|
||||
.join(",");
|
||||
|
||||
source[label] = values;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type === ExpressionResultType.SINGLE_VALUE) {
|
||||
source[c.label || name] = (results[0].values[0] || {}).value;
|
||||
for (const item of results) {
|
||||
const label = item.metric.labels
|
||||
.map((d: { key: string; value: string }) => `${d.key}=${d.value}`)
|
||||
.join(",");
|
||||
const values = item.values.map((d: { value: unknown }) => d.value) || [];
|
||||
if (results.length === 1) {
|
||||
source[label || c.label || name] = values;
|
||||
} else {
|
||||
source[label] = values;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (([ExpressionResultType.RECORD_LIST, ExpressionResultType.SORTED_LIST] as string[]).includes(type)) {
|
||||
source[name] = results[0].values;
|
||||
|
Reference in New Issue
Block a user