From f11e0842db803a28610fb6a3ded5a21d0985197c Mon Sep 17 00:00:00 2001 From: Alexander Zobnin Date: Thu, 7 May 2015 18:26:49 +0300 Subject: [PATCH] Fix host group list update. --- zabbix/partials/query.editor.html | 243 +++++++++++++++--------------- zabbix/queryCtrl.js | 11 +- 2 files changed, 126 insertions(+), 128 deletions(-) diff --git a/zabbix/partials/query.editor.html b/zabbix/partials/query.editor.html index faa2b26..35b4e8d 100644 --- a/zabbix/partials/query.editor.html +++ b/zabbix/partials/query.editor.html @@ -1,133 +1,132 @@ -
-
+
- -
    -
  • - {{targetLetters[$index]}} -
  • -
  • - - - -
  • -
+
    +
  • + {{targetLetters[$index]}} +
  • +
  • + + + +
  • +
- + -
+
-
+
diff --git a/zabbix/queryCtrl.js b/zabbix/queryCtrl.js index 588a652..29b1192 100644 --- a/zabbix/queryCtrl.js +++ b/zabbix/queryCtrl.js @@ -8,11 +8,6 @@ function (angular, _) { var module = angular.module('grafana.controllers'); var targetLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' - var hostGroupList = []; - var hostList = []; - var applicationList = []; - var itemList = []; - module.controller('ZabbixAPITargetCtrl', function($scope) { $scope.init = function() { @@ -26,7 +21,11 @@ function (angular, _) { // Update host group, host, application and item lists $scope.updateHostGroupList(); - $scope.updateHostList(); + if ($scope.target.hostGroup) { + $scope.updateHostList($scope.target.hostGroup.groupid); + } else { + $scope.updateHostList(); + } if ($scope.target.host) { $scope.updateAppList($scope.target.host.hostid); if ($scope.target.application) {