Commit 42caf02f by Denis Doria

Include context for operators

Depending of the value a different set of operators will show up.
If regex only =~ and !~ will show up.
Any other value will show =, <>, <, >.
parent 4bd83443
......@@ -156,10 +156,12 @@ function (angular, _, InfluxQueryBuilder) {
query = $scope.queryBuilder.buildExploreQuery('TAG_VALUES', $scope.tagSegments[index-2].value);
} else if (segment.type === 'condition') {
return $q.when([new MetricSegment('AND'), new MetricSegment('OR')]);
} else if (segment.type === 'operator') {
} else if (segment.type === 'operator' && /^(?!\/.*\/$)/.test($scope.tagSegments[index+1].value)) {
return $q.when([MetricSegment.newOperator('='), MetricSegment.newOperator('<>'),
MetricSegment.newOperator('<'), MetricSegment.newOperator('>'),
MetricSegment.newOperator('=~'), MetricSegment.newOperator('!~')]);
MetricSegment.newOperator('<'), MetricSegment.newOperator('>')]);
} else if (segment.type === 'operator' && /^\/.*\/$/.test($scope.tagSegments[index+1].value)) {
return $q.when([ MetricSegment.newOperator('=~'), MetricSegment.newOperator('!~')]);
}
else {
return $q.when([]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment