Browse Source

Datasource working with filters after fixing bugs

utkarshcmu 10 years ago
parent
commit
63dfa303e5
1 changed files with 9 additions and 6 deletions
  1. 9 6
      public/app/plugins/datasource/opentsdb/datasource.js

+ 9 - 6
public/app/plugins/datasource/opentsdb/datasource.js

@@ -89,6 +89,7 @@ function (angular, _, dateMath) {
       // In case the backend is 3rd-party hosted and does not suport OPTIONS, urlencoded requests
       // go as POST rather than OPTIONS+POST
       options.headers = { 'Content-Type': 'application/x-www-form-urlencoded' };
+
       return backendSrv.datasourceRequest(options);
     };
 
@@ -308,15 +309,17 @@ function (angular, _, dateMath) {
         }
       }
 
-      query.tags = angular.copy(target.tags);
-      if(query.tags){
-        for(var key in query.tags){
-          query.tags[key] = templateSrv.replace(query.tags[key], options.scopedVars);
+      if (target.filters && target.filters.length > 0) {
+        query.filters = angular.copy(target.filters);
+      } else {
+        query.tags = angular.copy(target.tags);
+        if(query.tags){
+          for(var key in query.tags){
+            query.tags[key] = templateSrv.replace(query.tags[key], options.scopedVars);
+          }
         }
       }
 
-      query.filters = angular.copy(target.filters);
-
       return query;
     }