From aa424af15beac720b2e42102a0c8a694039f8178 Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Mon, 25 May 2015 00:03:26 +0300 Subject: [PATCH] Fix item selection. --- zabbix/queryCtrl.js | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/zabbix/queryCtrl.js b/zabbix/queryCtrl.js index b6c99dc..2493624 100644 --- a/zabbix/queryCtrl.js +++ b/zabbix/queryCtrl.js @@ -189,13 +189,6 @@ function (angular, _) { $scope.datasource.performAppSuggestQuery(hostid).then(function (series) { $scope.metric.applicationList = $scope.metric.applicationList.concat(series); - // Add templated variables - _.each(templateSrv.variables, function(variable) { - $scope.metric.applicationList.push({ - name: '$' + variable.name - }) - }); - if ($scope.target.application) { $scope.target.application = $scope.metric.applicationList.filter(function (item, index, array) { // Find selected application in metric.hostList @@ -225,13 +218,13 @@ function (angular, _) { } }); }); - } - - if ($scope.target.item) { - $scope.target.item = $scope.metric.itemList.filter(function (item, index, array) { - // Find selected item in metric.hostList - return (item.name == $scope.target.item.name); - }).pop(); + } else { + if ($scope.target.item) { + $scope.target.item = $scope.metric.itemList.filter(function (item, index, array) { + // Find selected item in metric.hostList + return (item.name == $scope.target.item.name); + }).pop(); + } } };