mirror of
https://github.com/portainer/portainer.git
synced 2025-07-31 03:09:44 +02:00
refactor(app): move storidge to new 'integrations' module (#2905)
* refactor(app): move storidge to new 'integrations' module * style(storidge): revert TODO note removal
This commit is contained in:
parent
67de71a18f
commit
144e0ae07e
59 changed files with 32 additions and 29 deletions
|
@ -0,0 +1,26 @@
|
|||
angular.module('portainer.docker')
|
||||
.controller('StoridgeSnapshotCreationController', ['StoridgeSnapshotService', 'Notifications', '$state',
|
||||
function (StoridgeSnapshotService, Notifications, $state) {
|
||||
var ctrl = this;
|
||||
|
||||
this.formValues = {};
|
||||
this.state = {
|
||||
actionInProgress: false
|
||||
};
|
||||
|
||||
this.createSnapshot = function () {
|
||||
ctrl.state.actionInProgress = true;
|
||||
StoridgeSnapshotService.create(ctrl.volumeId, ctrl.formValues.Description)
|
||||
.then(function success() {
|
||||
Notifications.success('Success', 'Snapshot successfully created');
|
||||
$state.reload();
|
||||
})
|
||||
.catch(function error(err) {
|
||||
Notifications.error('Failure', err, 'Unable to create snapshot');
|
||||
})
|
||||
.finally(function final() {
|
||||
ctrl.state.actionInProgress = false;
|
||||
});
|
||||
};
|
||||
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue