fix(network-details): fix an issue caused by stopped containers (#1328)

pull/1309/head
Anthony Lapenna 7 years ago committed by GitHub
parent 711128284e
commit 25f325bbaa

@ -40,12 +40,14 @@ function ($scope, $state, $transition$, $filter, Network, NetworkService, Contai
var containersInNetwork = []; var containersInNetwork = [];
containers.forEach(function(container) { containers.forEach(function(container) {
var containerInNetwork = network.Containers[container.Id]; var containerInNetwork = network.Containers[container.Id];
containerInNetwork.Id = container.Id; if (containerInNetwork) {
// Name is not available in Docker 1.9 containerInNetwork.Id = container.Id;
if (!containerInNetwork.Name) { // Name is not available in Docker 1.9
containerInNetwork.Name = $filter('trimcontainername')(container.Names[0]); if (!containerInNetwork.Name) {
containerInNetwork.Name = $filter('trimcontainername')(container.Names[0]);
}
containersInNetwork.push(containerInNetwork);
} }
containersInNetwork.push(containerInNetwork);
}); });
$scope.containersInNetwork = containersInNetwork; $scope.containersInNetwork = containersInNetwork;
} }
@ -68,7 +70,7 @@ function ($scope, $state, $transition$, $filter, Network, NetworkService, Contai
}); });
} else { } else {
Container.query({ Container.query({
filters: {network: [$transition$.params().id]} filters: { network: [$transition$.params().id] }
}, function success(data) { }, function success(data) {
filterContainersInNetwork(network, data); filterContainersInNetwork(network, data);
$('#loadingViewSpinner').hide(); $('#loadingViewSpinner').hide();

Loading…
Cancel
Save