Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix empty settings error in containers topology #1507

Merged
merged 1 commit into from
Jun 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,20 @@ 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) {
} else if (data.data.settings && data.data.settings.containers_max_items) {
var size_limit = data.data.settings.containers_max_items;
var remove_hierarchy = ['Container',
'ContainerGroup',
'ContainerReplicator',
'ContainerService',
'ContainerRoute',
'Host',
'Vm',
'ContainerNode',
'ContainerManager'];
'ContainerGroup',
Copy link
Contributor

@himdel himdel Jun 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this is the wrong align for JS arrays. It was right before (except for the ending ] which should be on its own line).

'ContainerReplicator',
'ContainerService',
'ContainerRoute',
'Host',
'Vm',
'ContainerNode',
'ContainerManager'];
$scope.kinds = topologyService.reduce_kinds($scope.items, $scope.kinds, size_limit, remove_hierarchy);
}
}
Expand Down