Merge pull request #203 from cloud-inovasi/bug198-hidden-containers

fix(containers): make hidden containers labels available in the $scope
pull/204/head
Anthony Lapenna 8 years ago committed by GitHub
commit c82abae8e5

@ -14,13 +14,13 @@ function ($scope, Container, ContainerHelper, Info, Settings, Messages, Config)
$scope.sortType = sortType; $scope.sortType = sortType;
}; };
var update = function (data, containersToHideLabels) { var update = function (data) {
$('#loadContainersSpinner').show(); $('#loadContainersSpinner').show();
$scope.state.selectedItemCount = 0; $scope.state.selectedItemCount = 0;
Container.query(data, function (d) { Container.query(data, function (d) {
var containers = d; var containers = d;
if (containersToHideLabels) { if ($scope.containersToHideLabels) {
containers = ContainerHelper.hideContainers(d, containersToHideLabels); containers = ContainerHelper.hideContainers(d, $scope.containersToHideLabels);
} }
$scope.containers = containers.map(function (container) { $scope.containers = containers.map(function (container) {
var model = new ContainerViewModel(container); var model = new ContainerViewModel(container);
@ -147,15 +147,15 @@ function ($scope, Container, ContainerHelper, Info, Settings, Messages, Config)
$scope.swarm = false; $scope.swarm = false;
Config.$promise.then(function (c) { Config.$promise.then(function (c) {
var containersToHideLabels = c.hiddenLabels; $scope.containersToHideLabels = c.hiddenLabels;
$scope.swarm = c.swarm; $scope.swarm = c.swarm;
if (c.swarm) { if (c.swarm) {
Info.get({}, function (d) { Info.get({}, function (d) {
$scope.swarm_hosts = retrieveSwarmHostsInfo(d); $scope.swarm_hosts = retrieveSwarmHostsInfo(d);
update({all: Settings.displayAll ? 1 : 0}, containersToHideLabels); update({all: Settings.displayAll ? 1 : 0});
}); });
} else { } else {
update({all: Settings.displayAll ? 1 : 0}, containersToHideLabels); update({all: Settings.displayAll ? 1 : 0});
} }
}); });
}]); }]);

Loading…
Cancel
Save