fix, add targetContainsTemplate()

This commit is contained in:
Mitsuhiro Tanda 2017-09-29 13:24:18 +09:00
parent 8d6513a564
commit 5850ae51b1

View File

@ -300,6 +300,15 @@ function (angular, _, moment, dateMath, kbn, templatingVariable) {
}); });
}; };
this.targetContainsTemplate = function(target) {
return templateSrv.variableExists(target.region) ||
templateSrv.variableExists(target.namespace) ||
templateSrv.variableExists(target.metricName) ||
_.find(target.dimensions, function(v, k) {
return templateSrv.variableExists(k) || templateSrv.variableExists(v);
});
};
this.testDatasource = function() { this.testDatasource = function() {
/* use billing metrics for test */ /* use billing metrics for test */
var region = this.defaultRegion; var region = this.defaultRegion;