1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-24 15:59:41 +02:00
portainer/app/docker/views/secrets/edit/secretController.js
Chaim Lev-Ari e58acd7dd6 * chore(eslint): update esllint and remove unused variables
* chore(eslint-config): change no-unused-vars to warn

* chore(eslint): remove unused variables

* chore(eslint): allow unused globals

* fixup! chore(eslint): allow unused globals

* chore(eslint): remove commented unused vars

* fixup! chore(eslint): remove commented unused vars
2018-08-22 17:33:06 +02:00

27 lines
848 B
JavaScript

angular.module('portainer.docker')
.controller('SecretController', ['$scope', '$transition$', '$state', 'SecretService', 'Notifications',
function ($scope, $transition$, $state, SecretService, Notifications) {
$scope.removeSecret = function removeSecret(secretId) {
SecretService.remove(secretId)
.then(function success() {
Notifications.success('Secret successfully removed');
$state.go('docker.secrets', {});
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to remove secret');
});
};
function initView() {
SecretService.secret($transition$.params().id)
.then(function success(data) {
$scope.secret = data;
})
.catch(function error(err) {
Notifications.error('Failure', err, 'Unable to retrieve secret details');
});
}
initView();
}]);