mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
[elasticsearch] Fix add metric that was not working properly
when selecting Raw Documet metric type, the $scope.target.metrics was replaced by [$scope.agg], however the pointer to this variables is shared with metricAggs. Instead we free the array and add $scope.agg
This commit is contained in:
parent
966c2912fc
commit
d55cc4e2a3
@ -67,7 +67,6 @@ function (angular, _, queryDef) {
|
||||
} else if (!$scope.agg.field) {
|
||||
$scope.agg.field = 'select field';
|
||||
}
|
||||
|
||||
switch($scope.agg.type) {
|
||||
case 'cardinality': {
|
||||
var precision_threshold = $scope.agg.settings.precision_threshold || '';
|
||||
@ -105,12 +104,12 @@ function (angular, _, queryDef) {
|
||||
case 'raw_document': {
|
||||
$scope.agg.settings.size = $scope.agg.settings.size || 500;
|
||||
$scope.settingsLinkText = 'Size: ' + $scope.agg.settings.size ;
|
||||
$scope.target.metrics = [$scope.agg];
|
||||
$scope.target.metrics.splice(0,$scope.target.metrics.length, $scope.agg);
|
||||
|
||||
$scope.target.bucketAggs = [];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($scope.aggDef.supportsInlineScript) {
|
||||
// I know this stores the inline script twice
|
||||
// but having it like this simplifes the query_builder
|
||||
|
Loading…
Reference in New Issue
Block a user