mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(plugins): more upgrading work
This commit is contained in:
56
public/app/plugins/datasource/elasticsearch/directives.js
Normal file
56
public/app/plugins/datasource/elasticsearch/directives.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
define([
|
||||||
|
'angular',
|
||||||
|
'./bucket_agg',
|
||||||
|
'./metric_agg',
|
||||||
|
],
|
||||||
|
function (angular) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var module = angular.module('grafana.directives');
|
||||||
|
|
||||||
|
module.directive('metricQueryEditorElasticsearch', function() {
|
||||||
|
return {controller: 'ElasticQueryCtrl', templateUrl: 'app/plugins/datasource/elasticsearch/partials/query.editor.html'};
|
||||||
|
});
|
||||||
|
|
||||||
|
module.directive('metricQueryOptionsElasticsearch', function() {
|
||||||
|
return {templateUrl: 'app/plugins/datasource/elasticsearch/partials/query.options.html'};
|
||||||
|
});
|
||||||
|
|
||||||
|
module.directive('annotationsQueryEditorElasticsearch', function() {
|
||||||
|
return {templateUrl: 'app/plugins/datasource/elasticsearch/partials/annotations.editor.html'};
|
||||||
|
});
|
||||||
|
|
||||||
|
module.directive('elastic', function() {
|
||||||
|
return {templateUrl: 'app/plugins/datasource/elasticsearch/partials/config.html'};
|
||||||
|
});
|
||||||
|
|
||||||
|
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: "&",
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
define([
|
|
||||||
'angular'
|
|
||||||
],
|
|
||||||
function (angular) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var module = angular.module('grafana.services');
|
|
||||||
|
|
||||||
module.factory('GrafanaDatasource', function($q, backendSrv) {
|
|
||||||
|
|
||||||
function GrafanaDatasource() {
|
|
||||||
}
|
|
||||||
|
|
||||||
GrafanaDatasource.prototype.query = function(options) {
|
|
||||||
return backendSrv.get('/api/metrics/test', {
|
|
||||||
from: options.range.from.valueOf(),
|
|
||||||
to: options.range.to.valueOf(),
|
|
||||||
maxDataPoints: options.maxDataPoints
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
GrafanaDatasource.prototype.metricFindQuery = function() {
|
|
||||||
return $q.when([]);
|
|
||||||
};
|
|
||||||
|
|
||||||
return GrafanaDatasource;
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
define([
|
|
||||||
'angular',
|
|
||||||
],
|
|
||||||
function (angular) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var module = angular.module('grafana.directives');
|
|
||||||
|
|
||||||
module.directive('metricQueryEditorGrafana', function() {
|
|
||||||
return {templateUrl: 'app/plugins/datasource/grafana/partials/query.editor.html'};
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
@@ -3,10 +3,8 @@
|
|||||||
"name": "Grafana",
|
"name": "Grafana",
|
||||||
"id": "grafana",
|
"id": "grafana",
|
||||||
|
|
||||||
|
"module": "app/plugins/datasource/grafana/module",
|
||||||
|
|
||||||
"builtIn": true,
|
"builtIn": true,
|
||||||
|
|
||||||
"serviceName": "GrafanaDatasource",
|
|
||||||
|
|
||||||
"module": "app/plugins/datasource/grafana/datasource",
|
|
||||||
"metrics": true
|
"metrics": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,8 +30,3 @@ class MixedDatasource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export {MixedDatasource, MixedDatasource as Datasource}
|
export {MixedDatasource, MixedDatasource as Datasource}
|
||||||
|
|
||||||
// var module = angular.module('grafana.services');
|
|
||||||
// module.factory('MixedDatasource', MixedDatasource);
|
|
||||||
//
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user