|
@@ -1,51 +1,19 @@
|
|
|
define([
|
|
define([
|
|
|
- 'angular',
|
|
|
|
|
'./datasource',
|
|
'./datasource',
|
|
|
'./edit_view',
|
|
'./edit_view',
|
|
|
'./bucket_agg',
|
|
'./bucket_agg',
|
|
|
'./metric_agg',
|
|
'./metric_agg',
|
|
|
],
|
|
],
|
|
|
-function (angular, ElasticDatasource, editView) {
|
|
|
|
|
|
|
+function (ElasticDatasource, editView) {
|
|
|
'use strict';
|
|
'use strict';
|
|
|
|
|
|
|
|
- var module = angular.module('grafana.directives');
|
|
|
|
|
-
|
|
|
|
|
- module.directive('elasticMetricAgg', function() {
|
|
|
|
|
- return {
|
|
|
|
|
- templateUrl: 'app/plugins/datasource/elasticsearch/partials/metric_agg.html',
|
|
|
|
|
- controller: 'ElasticMetricAggCtrl',
|
|
|
|
|
- restrict: 'E',
|
|
|
|
|
- scope: {
|
|
|
|
|
- target: "=",
|
|
|
|
|
- index: "=",
|
|
|
|
|
- onChange: "&",
|
|
|
|
|
- getFields: "&",
|
|
|
|
|
- esVersion: '='
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- module.directive('elasticBucketAgg', function() {
|
|
|
|
|
- return {
|
|
|
|
|
- templateUrl: 'app/plugins/datasource/elasticsearch/partials/bucket_agg.html',
|
|
|
|
|
- controller: 'ElasticBucketAggCtrl',
|
|
|
|
|
- restrict: 'E',
|
|
|
|
|
- scope: {
|
|
|
|
|
- target: "=",
|
|
|
|
|
- index: "=",
|
|
|
|
|
- onChange: "&",
|
|
|
|
|
- getFields: "&",
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- module.directive('metricQueryEditorElasticsearch', function() {
|
|
|
|
|
|
|
+ function metricsQueryEditor() {
|
|
|
return {controller: 'ElasticQueryCtrl', templateUrl: 'app/plugins/datasource/elasticsearch/partials/query.editor.html'};
|
|
return {controller: 'ElasticQueryCtrl', templateUrl: 'app/plugins/datasource/elasticsearch/partials/query.editor.html'};
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- module.directive('metricQueryOptionsElasticsearch', function() {
|
|
|
|
|
|
|
+ function metricsQueryOptions() {
|
|
|
return {templateUrl: 'app/plugins/datasource/elasticsearch/partials/query.options.html'};
|
|
return {templateUrl: 'app/plugins/datasource/elasticsearch/partials/query.options.html'};
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
function annotationsQueryEditor() {
|
|
function annotationsQueryEditor() {
|
|
|
return {templateUrl: 'app/plugins/datasource/elasticsearch/partials/annotations.editor.html'};
|
|
return {templateUrl: 'app/plugins/datasource/elasticsearch/partials/annotations.editor.html'};
|
|
@@ -55,6 +23,8 @@ function (angular, ElasticDatasource, editView) {
|
|
|
Datasource: ElasticDatasource,
|
|
Datasource: ElasticDatasource,
|
|
|
configView: editView.default,
|
|
configView: editView.default,
|
|
|
annotationsQueryEditor: annotationsQueryEditor,
|
|
annotationsQueryEditor: annotationsQueryEditor,
|
|
|
|
|
+ metricsQueryEditor: metricsQueryEditor,
|
|
|
|
|
+ metricsQueryOptions: metricsQueryOptions,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
});
|
|
});
|