Skip to content

Commit

Permalink
fix empty settings error in containers topology
Browse files Browse the repository at this point in the history
  • Loading branch information
Ari Zellner committed Jun 8, 2017
1 parent d5d640a commit aa29759
Showing 1 changed file with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,21 +218,23 @@ function ContainerTopologyCtrl($scope, $http, $interval, topologyService, $windo
$scope.relations = data.data.relations;
$scope.kinds = data.data.kinds;
icons = data.data.icons;
var size_limit = data.data.settings.containers_max_items;

if (currentSelectedKinds && (Object.keys(currentSelectedKinds).length !== Object.keys($scope.kinds).length)) {
$scope.kinds = currentSelectedKinds;
} else if (size_limit > 0) {
var remove_hierarchy = ['Container',
'ContainerGroup',
'ContainerReplicator',
'ContainerService',
'ContainerRoute',
'Host',
'Vm',
'ContainerNode',
'ContainerManager'];
$scope.kinds = topologyService.reduce_kinds($scope.items, $scope.kinds, size_limit, remove_hierarchy);
} else if (data.data.settings && data.data.settings.containers_max_items) {
var size_limit = data.data.settings.containers_max_items;
if (size_limit > 0) {
var remove_hierarchy = ['Container',
'ContainerGroup',
'ContainerReplicator',
'ContainerService',
'ContainerRoute',
'Host',
'Vm',
'ContainerNode',
'ContainerManager'];
$scope.kinds = topologyService.reduce_kinds($scope.items, $scope.kinds, size_limit, remove_hierarchy);
}
}
}

Expand Down

0 comments on commit aa29759

Please sign in to comment.