From b52e5a69887da3d6c678bd3dbec1bc2f74cc8a41 Mon Sep 17 00:00:00 2001 From: Fine Date: Tue, 16 Apr 2024 14:38:52 +0800 Subject: [PATCH] refactor: update --- src/hooks/useExpressionsProcessor.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/hooks/useExpressionsProcessor.ts b/src/hooks/useExpressionsProcessor.ts index a55a6c2c..0a346108 100644 --- a/src/hooks/useExpressionsProcessor.ts +++ b/src/hooks/useExpressionsProcessor.ts @@ -112,20 +112,7 @@ export async function useExpressionsQueryProcessor(config: Indexable) { tips.push(obj.error); typesOfMQE.push(type); if (!obj.error) { - if (type === ExpressionResultType.TIME_SERIES_VALUES) { - 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(","); - if (results.length === 1) { - source[label || c.label || name] = values; - } else { - source[label] = values; - } - } - } - if (type === ExpressionResultType.SINGLE_VALUE) { + if ([ExpressionResultType.SINGLE_VALUE, ExpressionResultType.TIME_SERIES_VALUES].includes(type)) { for (const item of results) { const label = item.metric &&