mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
inject templateSrv
This commit is contained in:
parent
490141da82
commit
540436e9d5
@ -23,7 +23,7 @@ function (angular, _, moment, dateMath, CloudWatchAnnotationQuery) {
|
|||||||
|
|
||||||
var queries = [];
|
var queries = [];
|
||||||
options = angular.copy(options);
|
options = angular.copy(options);
|
||||||
options.targets = this.expandTemplateVariable(options.targets);
|
options.targets = this.expandTemplateVariable(options.targets, templateSrv);
|
||||||
_.each(options.targets, function(target) {
|
_.each(options.targets, function(target) {
|
||||||
if (target.hide || !target.namespace || !target.metricName || _.isEmpty(target.statistics)) {
|
if (target.hide || !target.namespace || !target.metricName || _.isEmpty(target.statistics)) {
|
||||||
return;
|
return;
|
||||||
@ -338,7 +338,7 @@ function (angular, _, moment, dateMath, CloudWatchAnnotationQuery) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.expandTemplateVariable = function(targets) {
|
this.expandTemplateVariable = function(targets, templateSrv) {
|
||||||
return _.chain(targets)
|
return _.chain(targets)
|
||||||
.map(function(target) {
|
.map(function(target) {
|
||||||
var dimensionKey = null;
|
var dimensionKey = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user