1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 07:19:41 +02:00

fix(ui): reset auto-scaling formvalues if needed [EE-6544] (#10969)

This commit is contained in:
Prabhat Khera 2024-01-18 07:59:00 +13:00 committed by GitHub
parent 115b01cee3
commit bf66b6c5f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 */