luci-base: static.js: make IPv6 assignment hint optional
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
af040702da
commit
120ece921d
1 changed files with 3 additions and 0 deletions
|
@ -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 = s.taboption('general', form.Value, 'ip6hint', _('IPv6 assignment hint'), _('Assign prefix parts using this hexadecimal subprefix ID for this interface.'));
|
||||||
o.placeholder = '0';
|
o.placeholder = '0';
|
||||||
o.validate = function(section_id, value) {
|
o.validate = function(section_id, value) {
|
||||||
|
if (value == null || value == '')
|
||||||
|
return true;
|
||||||
|
|
||||||
var n = parseInt(value, 16);
|
var n = parseInt(value, 16);
|
||||||
|
|
||||||
if (!/^(0x)?[0-9a-fA-F]+$/.test(value) || isNaN(n) || n >= 0xffffffff)
|
if (!/^(0x)?[0-9a-fA-F]+$/.test(value) || isNaN(n) || n >= 0xffffffff)
|
||||||
|
|
Loading…
Reference in a new issue