summaryrefslogtreecommitdiffhomepage
path: root/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2021-08-30 11:05:36 +0200
committerGitHub <noreply@github.com>2021-08-30 11:05:36 +0200
commita2e70ef0f94289d4d1ed4af208c349e15429a078 (patch)
tree1f7b3c2268930b911cb203355595252299e955b6 /protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
parent09e657e7894250691284946bba05ae0a08e4c5dd (diff)
parent092109c9056444a4ba691d15031f69403ab2b37c (diff)
Merge pull request #5310 from keith24/feature_optional-allowedips
luci-proto-wireguard: make AllowedIPs optional
Diffstat (limited to 'protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js')
-rw-r--r--protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js11
1 files changed, 2 insertions, 9 deletions
diff --git a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
index 6321f85d9b..e7e69a3d5b 100644
--- a/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
+++ b/protocols/luci-proto-wireguard/htdocs/luci-static/resources/protocol/wireguard.js
@@ -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.'));