mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
feat(container-details): add the ability to update restart policy
This commit is contained in:
parent
de9f99d030
commit
8769fadd5c
7 changed files with 130 additions and 13 deletions
|
@ -0,0 +1,36 @@
|
|||
angular
|
||||
.module('portainer.docker')
|
||||
.controller('ContainerRestartPolicyController', [
|
||||
function ContainerRestartPolicyController() {
|
||||
var ctrl = this;
|
||||
|
||||
this.state = {
|
||||
editMode :false,
|
||||
editModel :{}
|
||||
};
|
||||
|
||||
|
||||
ctrl.toggleEdit = toggleEdit;
|
||||
ctrl.save = save;
|
||||
|
||||
function toggleEdit() {
|
||||
ctrl.state.editMode = true;
|
||||
ctrl.state.editModel = {
|
||||
name: ctrl.name,
|
||||
maximumRetryCount: ctrl.maximumRetryCount
|
||||
};
|
||||
}
|
||||
|
||||
function save() {
|
||||
if (ctrl.state.editModel.name === ctrl.name &&
|
||||
ctrl.state.editModel.maximumRetryCount === ctrl.maximumRetryCount) {
|
||||
ctrl.state.editMode = false;
|
||||
return;
|
||||
}
|
||||
ctrl.updateRestartPolicy(ctrl.state.editModel)
|
||||
.then(function onUpdateSucceed() {
|
||||
ctrl.state.editMode = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
]);
|
Loading…
Add table
Add a link
Reference in a new issue