aviau 990f60c8cd Adapt to new live API
Change-Id: I59a1027a60f7d40c1a6db34e3b2c5588ed608540
2015-05-12 17:39:20 -04:00

23 lines
744 B
JavaScript

'use strict';
angular.module('bansho.table.cell_host', ['bansho.table'])
.controller('CellHostCtrl', ['$scope', function ($scope) {
$scope.cell_name = 'host';
if ($scope.entry.host_state === 'UP') {
$scope.state = 'state--ok';
} else if ($scope.entry.host_state === 'WARNING') {
$scope.state = 'state--warning';
} else if ($scope.entry.host_state === '') {
$scope.state = '';
} else {
$scope.state = 'state--error';
}
}])
.run(['tableGlobalConfig', function (tableGlobalConfig) {
tableGlobalConfig.cellToFieldsMap.host = ['host_state', 'host_name'];
tableGlobalConfig.cellWrappableField.host = 'host_name';
}]);