1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-03 04:45:21 +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:
Anthony Lapenna 2022-02-09 05:47:11 +13:00 committed by GitHub
parent e96f63023e
commit 318844226c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
87 changed files with 121 additions and 4959 deletions

View file

@ -12,7 +12,7 @@ angular.module('portainer.docker', ['portainer.app', containersModule]).config([
parent: 'endpoint',
url: '/docker',
abstract: true,
onEnter: /* @ngInject */ function onEnter(endpoint, $async, $state, EndpointService, EndpointProvider, LegacyExtensionManager, Notifications, StateManager, SystemService) {
onEnter: /* @ngInject */ function onEnter(endpoint, $async, $state, EndpointService, EndpointProvider, Notifications, StateManager, SystemService) {
return $async(async () => {
if (![1, 2, 4].includes(endpoint.Type)) {
$state.go('portainer.home');
@ -39,8 +39,7 @@ angular.module('portainer.docker', ['portainer.app', containersModule]).config([
EndpointProvider.setEndpointPublicURL(endpoint.PublicURL);
EndpointProvider.setOfflineModeFromStatus(endpoint.Status);
const extensions = await LegacyExtensionManager.initEndpointExtensions(endpoint);
await StateManager.updateEndpointState(endpoint, extensions);
await StateManager.updateEndpointState(endpoint);
} catch (e) {
Notifications.error('Failed loading environment', e);
$state.go('portainer.home', {}, { reload: true });

View file

@ -86,11 +86,6 @@ angular.module('portainer.docker').controller('CreateVolumeController', [
var name = $scope.formValues.Name;
var driver = $scope.formValues.Driver;
var driverOptions = $scope.formValues.DriverOptions;
var storidgeProfile = $scope.formValues.StoridgeProfile;
if (driver === 'cio:latest' && storidgeProfile) {
driverOptions.push({ name: 'profile', value: storidgeProfile.Name });
}
if ($scope.formValues.NFSData.useNFS) {
prepareNFSConfiguration(driverOptions);

View file

@ -83,12 +83,6 @@
</div>
<volumes-cifs-form data="formValues.CIFSData" ng-show="formValues.Driver === 'local'"></volumes-cifs-form>
<!-- !cifs-management -->
<!-- storidge -->
<div ng-if="formValues.Driver === 'cio:latest'">
<div class="col-sm-12 form-section-title"> Storidge </div>
<storidge-profile-selector storidge-profile="formValues.StoridgeProfile"></storidge-profile-selector>
</div>
<!-- storidge -->
<div ng-if="applicationState.endpoint.mode.agentProxy && applicationState.endpoint.mode.provider === 'DOCKER_SWARM_MODE' && formValues.Driver === 'local'">
<div class="col-sm-12 form-section-title"> Deployment </div>
<!-- node-selection -->

View file

@ -51,32 +51,6 @@
</div>
</div>
<div class="row" ng-if="isCioDriver">
<div class="col-sm-12">
<volume-storidge-info volume="storidgeVolume"> </volume-storidge-info>
</div>
</div>
<div class="row" ng-if="isCioDriver">
<div class="col-sm-12">
<storidge-snapshot-creation volume-id="storidgeVolume.Vdisk" ng-if="storidgeVolume.SnapshotEnabled"> </storidge-snapshot-creation>
</div>
</div>
<div class="row" ng-if="isCioDriver && storidgeVolume.SnapshotEnabled">
<div class="col-sm-12">
<storidge-snapshots-datatable
title-text="Snapshots"
title-icon="fa-camera"
dataset="storidgeSnapshots"
table-key="storidgeSnapshots"
order-by="Id"
remove-action="removeSnapshot"
>
</storidge-snapshots-datatable>
</div>
</div>
<!-- access-control-panel -->
<por-access-control-panel ng-if="volume" resource-id="volume.ResourceId" resource-control="volume.ResourceControl" resource-type="'volume'"> </por-access-control-panel>
<!-- !access-control-panel -->

View file

@ -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');