Commit 62895114 by utkarshcmu

Implmented targetContainsTemplate for OpenTSDB

parent 4c2f2eeb
...@@ -103,8 +103,24 @@ function (angular, _, dateMath) { ...@@ -103,8 +103,24 @@ function (angular, _, dateMath) {
}; };
this.targetContainsTemplate = function(target) { this.targetContainsTemplate = function(target) {
console.log(target); // Checking for template variables in filters
return false; if (target.filters.length > 0) {
for (var i = 0; i < target.filters.length; i++) {
if (templateSrv.variableExists(target.filters[i].filter)) {
return true;
}
}
}
// Checking for template variables in tags
else if (Object.keys(target.tags).length > 0) {
for (var tagKey in target.tags) {
if (templateSrv.variableExists(target.tags[tagKey])) {
return true;
}
}
} else {
return false;
}
}; };
this.performTimeSeriesQuery = function(queries, start, end) { this.performTimeSeriesQuery = function(queries, start, end) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment