mirror of https://github.com/portainer/portainer
fix(ui): reset auto-scaling formvalues if needed [EE-6544] (#10969)
parent
115b01cee3
commit
bf66b6c5f3
|
@ -286,7 +286,7 @@ class KubernetesCreateApplicationController {
|
||||||
onAutoScaleChange(values) {
|
onAutoScaleChange(values) {
|
||||||
return this.$async(async () => {
|
return this.$async(async () => {
|
||||||
// when enabling the auto scaler, set the default values
|
// when enabling the auto scaler, set the default values
|
||||||
if (!this.formValues.AutoScaler.isUsed && values.isUsed) {
|
if (!this.oldFormValues.AutoScaler.isUsed && values.isUsed) {
|
||||||
this.formValues.AutoScaler = {
|
this.formValues.AutoScaler = {
|
||||||
isUsed: values.isUsed,
|
isUsed: values.isUsed,
|
||||||
minReplicas: 1,
|
minReplicas: 1,
|
||||||
|
@ -297,6 +297,11 @@ class KubernetesCreateApplicationController {
|
||||||
}
|
}
|
||||||
// otherwise, just update the values
|
// otherwise, just update the values
|
||||||
this.formValues.AutoScaler = values;
|
this.formValues.AutoScaler = values;
|
||||||
|
|
||||||
|
// reset it to previous form values if the user disables the auto scaler
|
||||||
|
if (!this.oldFormValues.AutoScaler.isUsed && !values.isUsed) {
|
||||||
|
this.formValues.AutoScaler = this.oldFormValues.AutoScaler;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
/* #endregion */
|
/* #endregion */
|
||||||
|
|
Loading…
Reference in New Issue