Skip to content

Commit

Permalink
Improve app cpu and mem form validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Orlando Hohmeier committed Feb 16, 2016
1 parent 09b4aef commit 8bbd238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/stores/validators/AppFormValidators.js
Expand Up @@ -60,7 +60,7 @@ const AppFormValidators = {
}),

cpus: (value) => !Util.isStringAndEmpty(value) &&
!!value.toString().match(/^[0-9\.]+$/) && value >= 0.01,
!!value.toString().match(/^[0-9\.]+$/) && parseFloat(value) >= 0.01,

This comment has been minimized.

Copy link
@Poltergeist

Poltergeist Feb 16, 2016

Contributor

👍 for making sure to compare numbers.


disk: (value) => !Util.isStringAndEmpty(value) &&
!!value.toString().match(/^[0-9\.]+$/),
Expand Down Expand Up @@ -149,7 +149,7 @@ const AppFormValidators = {
!Util.isStringAndEmpty(obj.value)),

mem: (value) => !Util.isStringAndEmpty(value) &&
!!value.toString().match(/^[0-9\.]+$/) && value >= 32,
!!value.toString().match(/^[0-9\.]+$/) && parseInt(value) >= 32,

This comment has been minimized.

Copy link
@Poltergeist

Poltergeist Feb 16, 2016

Contributor

👍 for making sure to compare numbers.


ports: (ports) => Util.isStringAndEmpty(ports) ||
ports.split(",")
Expand Down

0 comments on commit 8bbd238

Please sign in to comment.