1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

feat(volumes): view dangling volumes (#993)

This commit is contained in:
Konstantin Azizov 2017-07-09 19:49:36 +03:00 committed by Anthony Lapenna
parent 6df5eb3787
commit fe5a993fc9
3 changed files with 36 additions and 9 deletions

View file

@ -65,13 +65,29 @@ function ($q, $scope, VolumeService, Notifications, Pagination) {
function initView() {
$('#loadVolumesSpinner').show();
VolumeService.volumes()
.then(function success(data) {
$scope.volumes = data;
$q.all({
attached: VolumeService.volumes({
filters: {
'dangling': ['false']
}
}),
dangling: VolumeService.volumes({
filters: {
'dangling': ['true']
}
})
})
.catch(function error(err) {
.then(function success(data) {
$scope.volumes = data.attached.map(function(volume) {
volume.dangling = false;
return volume;
}).concat(data.dangling.map(function(volume) {
volume.dangling = true;
return volume;
}));
}).catch(function error(err) {
Notifications.error('Failure', err, 'Unable to retrieve volumes');
$scope.volumes = [];
})
.finally(function final() {
$('#loadVolumesSpinner').hide();