summaryrefslogtreecommitdiffstats
path: root/app/configuration/controllers/network-controller.html
diff options
context:
space:
mode:
authorGunnar Mills <gmills@us.ibm.com>2018-06-04 14:23:33 -0500
committerGunnar Mills <gmills@us.ibm.com>2018-06-14 08:19:19 -0500
commit6549114edd82ff42e817be55969d775ceab91973 (patch)
tree9077b4c124506408e448b46be3fdd3d698538180 /app/configuration/controllers/network-controller.html
parent0af165b9378bb5cb544c26a7936142335d52257b (diff)
downloadphosphor-webui-6549114edd82ff42e817be55969d775ceab91973.tar.gz
phosphor-webui-6549114edd82ff42e817be55969d775ceab91973.zip
Add IPV4 properties parameter validation
Added parameter validation for the IPV4 properties: IP Address, Gateway, and Netmask prefix length. This is important since we delete the IPV4 interface before adding the new one (i.e. if the add is unsuccessful we are down an IPV4 interface). This validation helps to prevent some of the unsuccessful adds. Took the logic from the network manager valid parameter checks: https://github.com/openbmc/phosphor-networkd/blob/master/util.cpp#L217 Moved "Netmask Prefix Length" to a "number" to do this. It should have been a number. Tested: A variety of good and bad values. Change-Id: Idf4486489097bc426164b9543ea8c05eb54a2bf8 Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'app/configuration/controllers/network-controller.html')
-rw-r--r--app/configuration/controllers/network-controller.html3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/configuration/controllers/network-controller.html b/app/configuration/controllers/network-controller.html
index d237d47..41ab8a3 100644
--- a/app/configuration/controllers/network-controller.html
+++ b/app/configuration/controllers/network-controller.html
@@ -61,9 +61,10 @@
<label for="net-config__subnet" class="inline">Gateway</label>
<input id="net-config__subnet" type="text" ng-disabled="interface.DHCPEnabled" value="" ng-model="ipv4.Gateway"/>
</div>
+ <!-- This netmask prefix length max only works with IPV4 -->
<div class="column small-12 large-4">
<label for="net-config__default-gateway" class="inline">Netmask Prefix Length</label>
- <input id="net-config__default-gateway" type="text" ng-disabled="interface.DHCPEnabled" ng-model="ipv4.PrefixLength"/>
+ <input id="net-config__default-gateway" type="number" min="1" max="32" step="1" ng-disabled="interface.DHCPEnabled" ng-model="ipv4.PrefixLength"/>
</div>
</fieldset>
</fieldset>
OpenPOWER on IntegriCloud