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:
parent
6df5eb3787
commit
fe5a993fc9
3 changed files with 36 additions and 9 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue