2018-08-16 09:31:00 +00:00
|
|
|
angular
|
2018-09-15 01:53:35 +00:00
|
|
|
.module('portainer.docker')
|
|
|
|
.controller('ContainerRestartPolicyController', [function ContainerRestartPolicyController() {
|
|
|
|
var ctrl = this;
|
2018-08-16 09:31:00 +00:00
|
|
|
|
2018-09-15 01:53:35 +00:00
|
|
|
this.state = {
|
|
|
|
editModel : {}
|
|
|
|
};
|
2018-08-16 09:31:00 +00:00
|
|
|
|
2018-09-15 01:53:35 +00:00
|
|
|
ctrl.save = save;
|
2018-08-16 09:31:00 +00:00
|
|
|
|
2018-09-15 01:53:35 +00:00
|
|
|
function save() {
|
|
|
|
if (ctrl.state.editModel.name === ctrl.name && ctrl.state.editModel.maximumRetryCount === ctrl.maximumRetryCount) {
|
|
|
|
return;
|
2018-08-16 09:31:00 +00:00
|
|
|
}
|
2018-09-15 01:53:35 +00:00
|
|
|
ctrl.updateRestartPolicy(ctrl.state.editModel);
|
|
|
|
}
|
|
|
|
|
|
|
|
this.$onInit = function() {
|
|
|
|
ctrl.state.editModel = {
|
2018-09-15 02:19:51 +00:00
|
|
|
name: ctrl.name ? ctrl.name : 'no',
|
2018-09-15 01:53:35 +00:00
|
|
|
maximumRetryCount: ctrl.maximumRetryCount
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
]);
|