2018-02-01 12:27:52 +00:00
|
|
|
angular.module('portainer.docker')
|
2018-02-27 07:19:21 +00:00
|
|
|
.controller('ConfigController', ['$scope', '$transition$', '$state', 'ConfigService', 'Notifications',
|
|
|
|
function ($scope, $transition$, $state, ConfigService, Notifications) {
|
2017-11-06 08:47:31 +00:00
|
|
|
|
|
|
|
$scope.removeConfig = function removeConfig(configId) {
|
|
|
|
ConfigService.remove(configId)
|
2018-08-22 15:33:06 +00:00
|
|
|
.then(function success() {
|
2017-11-06 08:47:31 +00:00
|
|
|
Notifications.success('Config successfully removed');
|
2018-02-01 12:27:52 +00:00
|
|
|
$state.go('docker.configs', {});
|
2017-11-06 08:47:31 +00:00
|
|
|
})
|
|
|
|
.catch(function error(err) {
|
|
|
|
Notifications.error('Failure', err, 'Unable to remove config');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
function initView() {
|
|
|
|
ConfigService.config($transition$.params().id)
|
|
|
|
.then(function success(data) {
|
|
|
|
$scope.config = data;
|
|
|
|
})
|
|
|
|
.catch(function error(err) {
|
|
|
|
Notifications.error('Failure', err, 'Unable to retrieve config details');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
initView();
|
|
|
|
}]);
|