Hackish way of hiding hosts with multiple services

This commit is contained in:
Frédéric Vachon 2015-02-18 09:22:00 -05:00
parent f30de8d939
commit 80934ea2e9
3 changed files with 10 additions and 6 deletions

View File

@ -7,6 +7,8 @@ angular.module('adagios.table.cell_host', ['adagios.table'])
$scope.state = 'state--ok';
} else if ($scope.entry.host_state === 1) {
$scope.state = 'state--warning';
} else if ($scope.entry.host_state == "") {
$scope.state = '';
} else {
$scope.state = 'state--error';
}

View File

@ -9,7 +9,7 @@
</tr>
</thead>
<tbody class="" ng-repeat="entry in entries">
<tbody class="{{entry.child_class}}" ng-repeat="entry in entries">
<tr>
<td><input type="checkbox"></td>
<td adg-cell cell-name="{{cell}}" ng-repeat="cell in cellsName"></td>

View File

@ -45,24 +45,27 @@ angular.module('adagios.table', ['adagios.live',
parent_found = false,
i;
if (!!data.host) {
return data;
}
for (i = 0; i < data.length; i += 1) {
entry = data[i];
if (entry.host_name === undefined) return data;
actual_host = entry.host_name;
if (entry.host_name === last_host) {
if (!data[i-1].has_child && !parent_found) {
data[i-1].has_child = 1;
data[i-1].child_class='state--hasChild';
entry.child_class='state--isChild';
entry.host_state = "";
parent_found = true;
} else {
entry.is_child = 1;
entry.child_class='state--isChild';
entry.host_state = "";
}
entry.host_name = "";
} else {
first_child = false;
parent_found = false;
@ -77,7 +80,6 @@ angular.module('adagios.table', ['adagios.live',
getServices(requestFields, filters, tableConfig.apiName)
.success(function (data) {
$scope.entries = processMultipleServicesPerHost(data);
console.log($scope.entries);
});
}])