mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Loki Query Builder: Fix bug parsing range params (#61678)
feat(loki-query-builder): fix bug parsing range params
This commit is contained in:
@@ -413,10 +413,11 @@ function handleRangeAggregation(expr: string, node: SyntaxNode, context: Context
|
||||
const number = node.getChild(NumberLezer);
|
||||
const logExpr = node.getChild(LogRangeExpr);
|
||||
const params = number !== null && number !== undefined ? [getString(expr, number)] : [];
|
||||
const range = logExpr?.getChild(Range);
|
||||
const rangeValue = range ? getString(expr, range) : null;
|
||||
|
||||
let match = getString(expr, node).match(/\[(.+)\]/);
|
||||
if (match?.[1]) {
|
||||
params.unshift(match[1]);
|
||||
if (rangeValue) {
|
||||
params.unshift(rangeValue.substring(1, rangeValue.length - 1));
|
||||
}
|
||||
|
||||
const op = {
|
||||
|
||||
Reference in New Issue
Block a user