Improved host status algo

Change-Id: I9f1d2ad575647294d086d0b3700e482e2ec3b746
This commit is contained in:
aviau 2015-05-07 16:23:28 -04:00
parent b4579ef5d7
commit 8be28e0fa5
2 changed files with 4 additions and 4 deletions

View File

@ -84,4 +84,4 @@ angular.module('bansho.table.actionbar')
});
});
};
}])
}]);

View File

@ -9,13 +9,13 @@ angular.module('bansho.table.cell_host_status', ['bansho.table'])
if ($scope.entry.last_check === 0) {
$scope.alert_level = "alert alert-info";
$scope.entry.host_status = "Pending";
} else if ($scope.entry.state === 0) {
} else if ($scope.entry.host_state === 0) {
$scope.alert_level = "alert alert-success";
$scope.entry.host_status = "Host UP";
} else {
$scope.alert_level = "alert alert-danger";
if ($scope.entry.childs.length !== 0) {
if ($scope.entry.parents.length === 0) {
$scope.entry.host_status = "Host down";
} else {
$scope.entry.host_status = "Network outage";
@ -24,5 +24,5 @@ angular.module('bansho.table.cell_host_status', ['bansho.table'])
}])
.run(['tableGlobalConfig', function (tableGlobalConfig) {
tableGlobalConfig.cellToFieldsMap.host_status = ['state', 'last_check', 'childs'];
tableGlobalConfig.cellToFieldsMap.host_status = ['state', 'last_check', 'parents'];
}]);