mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
refactor(storidge): remove Storidge support from backend [EE-2450] (#6511)
* refactor(storidge): remove Storidge support from backend * refactor(storidge): remove Storidge support from backend * refactor(storidge): remove Storidge support from frontend
This commit is contained in:
parent
e96f63023e
commit
318844226c
87 changed files with 121 additions and 4959 deletions
|
@ -8,48 +8,7 @@ angular.module('portainer.docker').controller('VolumeController', [
|
|||
'ContainerService',
|
||||
'Notifications',
|
||||
'HttpRequestHelper',
|
||||
'StoridgeVolumeService',
|
||||
'StoridgeSnapshotService',
|
||||
function ($scope, $state, $transition$, $q, ModalService, VolumeService, ContainerService, Notifications, HttpRequestHelper, StoridgeVolumeService, StoridgeSnapshotService) {
|
||||
$scope.storidgeSnapshots = [];
|
||||
$scope.storidgeVolume = {};
|
||||
|
||||
$scope.removeSnapshot = function (selectedItems) {
|
||||
ModalService.confirm({
|
||||
title: 'Are you sure?',
|
||||
message: 'Do you want really want to remove this snapshot?',
|
||||
buttons: {
|
||||
confirm: {
|
||||
label: 'Remove',
|
||||
className: 'btn-danger',
|
||||
},
|
||||
},
|
||||
callback: function onConfirm(confirmed) {
|
||||
if (!confirmed) {
|
||||
return;
|
||||
}
|
||||
var actionCount = selectedItems.length;
|
||||
angular.forEach(selectedItems, function (item) {
|
||||
StoridgeSnapshotService.remove(item.Id)
|
||||
.then(function success() {
|
||||
Notifications.success('Snapshot successfully removed', item.Id);
|
||||
var index = $scope.storidgeSnapshots.indexOf(item);
|
||||
$scope.storidgeSnapshots.splice(index, 1);
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to remove snapshot');
|
||||
})
|
||||
.finally(function final() {
|
||||
--actionCount;
|
||||
if (actionCount === 0) {
|
||||
$state.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
function ($scope, $state, $transition$, $q, ModalService, VolumeService, ContainerService, Notifications, HttpRequestHelper) {
|
||||
$scope.removeVolume = function removeVolume() {
|
||||
ModalService.confirmDeletion('Do you want to remove this volume?', (confirmed) => {
|
||||
if (confirmed) {
|
||||
|
@ -80,15 +39,7 @@ angular.module('portainer.docker').controller('VolumeController', [
|
|||
$scope.volume = volume;
|
||||
var containerFilter = { volume: [volume.Id] };
|
||||
|
||||
$scope.isCioDriver = volume.Driver.includes('cio');
|
||||
if ($scope.isCioDriver) {
|
||||
return $q.all({
|
||||
containers: ContainerService.containers(1, containerFilter),
|
||||
storidgeVolume: StoridgeVolumeService.volume($transition$.params().id),
|
||||
});
|
||||
} else {
|
||||
return ContainerService.containers(1, containerFilter);
|
||||
}
|
||||
return ContainerService.containers(1, containerFilter);
|
||||
})
|
||||
.then(function success(data) {
|
||||
var dataContainers = $scope.isCioDriver ? data.containers : data;
|
||||
|
@ -98,16 +49,6 @@ angular.module('portainer.docker').controller('VolumeController', [
|
|||
return container;
|
||||
});
|
||||
$scope.containersUsingVolume = containers;
|
||||
|
||||
if ($scope.isCioDriver) {
|
||||
$scope.storidgeVolume = data.storidgeVolume;
|
||||
if ($scope.storidgeVolume.SnapshotEnabled) {
|
||||
return StoridgeSnapshotService.snapshots(data.storidgeVolume.Vdisk);
|
||||
}
|
||||
}
|
||||
})
|
||||
.then(function success(data) {
|
||||
$scope.storidgeSnapshots = data;
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to retrieve volume details');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue