mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix elastic ng-inject (build issue) (#14195)
fix elastic ng-inject issue in query editor
This commit is contained in:
parent
9afb8b64ed
commit
2faf8c722f
@ -2,22 +2,8 @@ import coreModule from 'app/core/core_module';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import * as queryDef from './query_def';
|
import * as queryDef from './query_def';
|
||||||
|
|
||||||
export function elasticBucketAgg() {
|
|
||||||
return {
|
|
||||||
templateUrl: 'public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html',
|
|
||||||
controller: 'ElasticBucketAggCtrl',
|
|
||||||
restrict: 'E',
|
|
||||||
scope: {
|
|
||||||
target: '=',
|
|
||||||
index: '=',
|
|
||||||
onChange: '&',
|
|
||||||
getFields: '&',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ElasticBucketAggCtrl {
|
export class ElasticBucketAggCtrl {
|
||||||
/** @nginject */
|
/** @ngInject */
|
||||||
constructor($scope, uiSegmentSrv, $q, $rootScope) {
|
constructor($scope, uiSegmentSrv, $q, $rootScope) {
|
||||||
const bucketAggs = $scope.target.bucketAggs;
|
const bucketAggs = $scope.target.bucketAggs;
|
||||||
|
|
||||||
@ -226,5 +212,18 @@ export class ElasticBucketAggCtrl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function elasticBucketAgg() {
|
||||||
|
return {
|
||||||
|
templateUrl: 'public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html',
|
||||||
|
controller: ElasticBucketAggCtrl,
|
||||||
|
restrict: 'E',
|
||||||
|
scope: {
|
||||||
|
target: '=',
|
||||||
|
index: '=',
|
||||||
|
onChange: '&',
|
||||||
|
getFields: '&',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
coreModule.directive('elasticBucketAgg', elasticBucketAgg);
|
coreModule.directive('elasticBucketAgg', elasticBucketAgg);
|
||||||
coreModule.controller('ElasticBucketAggCtrl', ElasticBucketAggCtrl);
|
|
||||||
|
@ -2,22 +2,8 @@ import coreModule from 'app/core/core_module';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import * as queryDef from './query_def';
|
import * as queryDef from './query_def';
|
||||||
|
|
||||||
export function elasticMetricAgg() {
|
|
||||||
return {
|
|
||||||
templateUrl: 'public/app/plugins/datasource/elasticsearch/partials/metric_agg.html',
|
|
||||||
controller: 'ElasticMetricAggCtrl',
|
|
||||||
restrict: 'E',
|
|
||||||
scope: {
|
|
||||||
target: '=',
|
|
||||||
index: '=',
|
|
||||||
onChange: '&',
|
|
||||||
getFields: '&',
|
|
||||||
esVersion: '=',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ElasticMetricAggCtrl {
|
export class ElasticMetricAggCtrl {
|
||||||
|
/** @ngInject */
|
||||||
constructor($scope, uiSegmentSrv, $q, $rootScope) {
|
constructor($scope, uiSegmentSrv, $q, $rootScope) {
|
||||||
const metricAggs = $scope.target.metrics;
|
const metricAggs = $scope.target.metrics;
|
||||||
$scope.metricAggTypes = queryDef.getMetricAggTypes($scope.esVersion);
|
$scope.metricAggTypes = queryDef.getMetricAggTypes($scope.esVersion);
|
||||||
@ -209,5 +195,19 @@ export class ElasticMetricAggCtrl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function elasticMetricAgg() {
|
||||||
|
return {
|
||||||
|
templateUrl: 'public/app/plugins/datasource/elasticsearch/partials/metric_agg.html',
|
||||||
|
controller: ElasticMetricAggCtrl,
|
||||||
|
restrict: 'E',
|
||||||
|
scope: {
|
||||||
|
target: '=',
|
||||||
|
index: '=',
|
||||||
|
onChange: '&',
|
||||||
|
getFields: '&',
|
||||||
|
esVersion: '=',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
coreModule.directive('elasticMetricAgg', elasticMetricAgg);
|
coreModule.directive('elasticMetricAgg', elasticMetricAgg);
|
||||||
coreModule.controller('ElasticMetricAggCtrl', ElasticMetricAggCtrl);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user