luci-base: static.js: make IPv6 assignment hint optional
authorJo-Philipp Wich <jo@mein.io>
Tue, 15 Oct 2019 07:14:36 +0000 (09:14 +0200)
committerJo-Philipp Wich <jo@mein.io>
Tue, 15 Oct 2019 07:14:56 +0000 (09:14 +0200)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/protocol/static.js

index 8470e0a20eca32387653de5dd893f2f682712809..9039acd5f3ca43ff134b0a0b5cb93eea7383c66d 100644 (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)