luci-base: static.js: make IPv6 assignment hint optional

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-10-15 09:14:36 +02:00
parent af040702da
commit 120ece921d

View file

@ -189,6 +189,9 @@ return network.registerProtocol('static', {
o = s.taboption('general', form.Value, 'ip6hint', _('IPv6 assignment hint'), _('Assign prefix parts using this hexadecimal subprefix ID for this interface.'));
o.placeholder = '0';
o.validate = function(section_id, value) {
if (value == null || value == '')
return true;
var n = parseInt(value, 16);
if (!/^(0x)?[0-9a-fA-F]+$/.test(value) || isNaN(n) || n >= 0xffffffff)