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];
if (containerInNetwork) {
containerInNetwork.Id = container.Id; containerInNetwork.Id = container.Id;
// Name is not available in Docker 1.9 // Name is not available in Docker 1.9
if (!containerInNetwork.Name) { if (!containerInNetwork.Name) {
containerInNetwork.Name = $filter('trimcontainername')(container.Names[0]); containerInNetwork.Name = $filter('trimcontainername')(container.Names[0]);
} }
containersInNetwork.push(containerInNetwork); containersInNetwork.push(containerInNetwork);
}
}); });
$scope.containersInNetwork = containersInNetwork; $scope.containersInNetwork = containersInNetwork;
} }

Loading…
Cancel
Save