Skip to content

Commit

Permalink
iss #36 - Some refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Jul 11, 2015
1 parent a671b84 commit d716c26
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions zabbix/datasource.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ function (angular, _, kbn) {
if (target.hostFilter && _.every(items, _.identity.hosts)) {

// Use templated variables in filter
var pattern = templateSrv.replace(target.hostFilter);
var host_pattern = new RegExp(pattern);
var host_pattern = new RegExp(templateSrv.replace(target.hostFilter));
items = _.filter(items, function (item) {
return _.some(item.hosts, function (host) {
return host_pattern.test(host.name);
Expand All @@ -108,8 +107,7 @@ function (angular, _, kbn) {
if (target.itemFilter) {

// Use templated variables in filter
var pattern = templateSrv.replace(target.itemFilter);
var item_pattern = new RegExp(pattern);
var item_pattern = new RegExp(templateSrv.replace(target.itemFilter));
return _.filter(items, function (item) {
return item_pattern.test(zabbixHelperSrv.expandItemName(item));
});
Expand Down

0 comments on commit d716c26

Please sign in to comment.