luci-app-wireguard: set allowed_ips option as optional value
Signed-off-by: Keith Irwin <git@ki9.us>
(cherry picked from commit 092109c905
)
fixed commit title
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
3c115cddd4
commit
71fe35ce69
1 changed files with 2 additions and 9 deletions
|
@ -140,16 +140,9 @@ return network.registerProtocol('wireguard', {
|
|||
o.validate = validateBase64;
|
||||
o.optional = true;
|
||||
|
||||
o = ss.option(form.DynamicList, 'allowed_ips', _('Allowed IPs'), _("Required. IP addresses and prefixes that this peer is allowed to use inside the tunnel. Usually the peer's tunnel IP addresses and the networks the peer routes through the tunnel."));
|
||||
o = ss.option(form.DynamicList, 'allowed_ips', _('Allowed IPs'), _("Optional. IP addresses and prefixes that this peer is allowed to use inside the tunnel. Usually the peer's tunnel IP addresses and the networks the peer routes through the tunnel."));
|
||||
o.datatype = 'ipaddr';
|
||||
o.validate = function(section, value) {
|
||||
var opt = this.map.lookupOption('allowed_ips', section);
|
||||
var ips = opt[0].formvalue(section);
|
||||
if (ips.length == 0) {
|
||||
return _('Value must not be empty');
|
||||
}
|
||||
return true;
|
||||
};
|
||||
o.optional = true;
|
||||
|
||||
o = ss.option(form.Flag, 'route_allowed_ips', _('Route Allowed IPs'), _('Optional. Create routes for Allowed IPs for this peer.'));
|
||||
|
||||
|
|
Loading…
Reference in a new issue