Fix host group list update.
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
<div class="editor-row">
|
<div class="editor-row">
|
||||||
<div ng-repeat="target in panel.targets"
|
<div ng-repeat="target in panel.targets"
|
||||||
class="grafana-target"
|
class="grafana-target"
|
||||||
@@ -114,7 +113,7 @@
|
|||||||
class="input-medium grafana-target-segment-input"
|
class="input-medium grafana-target-segment-input"
|
||||||
ng-change="selectItem()"
|
ng-change="selectItem()"
|
||||||
ng-model="target.item"
|
ng-model="target.item"
|
||||||
bs-tooltip="target.expandedName.length > 30 ? target.expandedName : ''"
|
bs-tooltip="target.item.expandedName.length > 30 ? target.item.expandedName : ''"
|
||||||
ng-options="item.expandedName for item in metric.itemList" >
|
ng-options="item.expandedName for item in metric.itemList" >
|
||||||
<option value="">--select item--</option>
|
<option value="">--select item--</option>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -8,11 +8,6 @@ function (angular, _) {
|
|||||||
var module = angular.module('grafana.controllers');
|
var module = angular.module('grafana.controllers');
|
||||||
var targetLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
var targetLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||||
|
|
||||||
var hostGroupList = [];
|
|
||||||
var hostList = [];
|
|
||||||
var applicationList = [];
|
|
||||||
var itemList = [];
|
|
||||||
|
|
||||||
module.controller('ZabbixAPITargetCtrl', function($scope) {
|
module.controller('ZabbixAPITargetCtrl', function($scope) {
|
||||||
|
|
||||||
$scope.init = function() {
|
$scope.init = function() {
|
||||||
@@ -26,7 +21,11 @@ function (angular, _) {
|
|||||||
|
|
||||||
// Update host group, host, application and item lists
|
// Update host group, host, application and item lists
|
||||||
$scope.updateHostGroupList();
|
$scope.updateHostGroupList();
|
||||||
|
if ($scope.target.hostGroup) {
|
||||||
|
$scope.updateHostList($scope.target.hostGroup.groupid);
|
||||||
|
} else {
|
||||||
$scope.updateHostList();
|
$scope.updateHostList();
|
||||||
|
}
|
||||||
if ($scope.target.host) {
|
if ($scope.target.host) {
|
||||||
$scope.updateAppList($scope.target.host.hostid);
|
$scope.updateAppList($scope.target.host.hostid);
|
||||||
if ($scope.target.application) {
|
if ($scope.target.application) {
|
||||||
|
|||||||
Reference in New Issue
Block a user