mirror of https://github.com/portainer/portainer
fix(k8s/application): improve ux for instance count input in creation/edition application (#4498)
parent
380f106571
commit
487123491e
|
@ -778,6 +778,7 @@
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
type="number"
|
type="number"
|
||||||
|
name="replica_count"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
min="1"
|
min="1"
|
||||||
max="9999"
|
max="9999"
|
||||||
|
@ -785,10 +786,19 @@
|
||||||
style="margin-left: 20px;"
|
style="margin-left: 20px;"
|
||||||
ng-model="ctrl.formValues.ReplicaCount"
|
ng-model="ctrl.formValues.ReplicaCount"
|
||||||
ng-disabled="!ctrl.supportScalableReplicaDeployment()"
|
ng-disabled="!ctrl.supportScalableReplicaDeployment()"
|
||||||
ng-change="ctrl.enforceReplicaCountMinimum()"
|
ng-change="ctrl.onChangeVolumeRequestedSize()"
|
||||||
|
required
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group" ng-if="kubernetesApplicationCreationForm['replica_count'].$invalid">
|
||||||
|
<div class="col-sm-12 small text-warning">
|
||||||
|
<ng-messages for="kubernetesApplicationCreationForm['replica_count'].$error">
|
||||||
|
<p ng-message="required"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Instance count is required.</p>
|
||||||
|
<p ng-message="min"><i class="fa fa-exclamation-triangle" aria-hidden="true"></i> Instance count must be greater than 0.</p>
|
||||||
|
</ng-messages>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<!-- !replica count -->
|
<!-- !replica count -->
|
||||||
|
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -488,12 +488,6 @@ class KubernetesCreateApplicationController {
|
||||||
return _.uniq(storageOptions).join(', ');
|
return _.uniq(storageOptions).join(', ');
|
||||||
}
|
}
|
||||||
|
|
||||||
enforceReplicaCountMinimum() {
|
|
||||||
if (this.formValues.ReplicaCount === null) {
|
|
||||||
this.formValues.ReplicaCount = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resourceQuotaCapacityExceeded() {
|
resourceQuotaCapacityExceeded() {
|
||||||
return !this.state.sliders.memory.max || !this.state.sliders.cpu.max;
|
return !this.state.sliders.memory.max || !this.state.sliders.cpu.max;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue