1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00
portainer/app/docker/views/configs/edit/configController.js
Anthony Lapenna 9b80b6adb2
refactor(code-editor): introduce code-editor component (#1674)
* refactor(code-editor): introduce code-editor component

* refactor(code-editor): add some extra validation
2018-02-27 08:19:21 +01:00

27 lines
852 B
JavaScript

angular.module('portainer.docker')
.controller('ConfigController', ['$scope', '$transition$', '$state', 'ConfigService', 'Notifications',
function ($scope, $transition$, $state, ConfigService, Notifications) {
$scope.removeConfig = function removeConfig(configId) {
ConfigService.remove(configId)
.then(function success(data) {
Notifications.success('Config successfully removed');
$state.go('docker.configs', {});
})
.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();
}]);