summaryrefslogtreecommitdiffhomepage
path: root/protocols/luci-proto-gre/htdocs/luci-static/resources
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/luci-proto-gre/htdocs/luci-static/resources')
-rw-r--r--protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js20
-rw-r--r--protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js18
-rw-r--r--protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js18
-rw-r--r--protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js18
4 files changed, 57 insertions, 17 deletions
diff --git a/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js b/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js
index e431bccd76..91837b29c3 100644
--- a/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js
+++ b/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gre.js
@@ -46,6 +46,13 @@ return network.registerProtocol('gre', {
o = s.taboption('general', form.Value, 'ipaddr', _("Local IPv4 address"), _("The local IPv4 address over which the tunnel is created (optional)."));
o.optional = true;
o.datatype = 'ip4addr("nomask")';
+ o.load = function(section_id) {
+ return network.getWANNetworks().then(L.bind(function(nets) {
+ if (nets.length)
+ this.placeholder = nets[0].getIPAddr();
+ return form.Value.prototype.load.apply(this, [section_id]);
+ }, this));
+ };
// -- advanced ---------------------------------------------------------------------
@@ -59,16 +66,16 @@ return network.registerProtocol('gre', {
o.placeholder = 1280;
o.datatype = 'range(68, 9200)';
- o = s.taboption('advanced', form.Value, 'ttl', _("Override TTL"), _("Specify a TTL (Time to Live) for the encapsulating packet other than the default (64) (optional)."));
+ o = s.taboption('advanced', form.Value, 'ttl', _("Override TTL"), _("Specify a TTL (Time to Live) for the encapsulating packet other than the default (64)."));
o.optional = true;
o.placeholder = 64;
o.datatype = 'min(1)';
- o = s.taboption('advanced', form.Value, 'tos', _('Override TOS'), _("Specify a TOS (Type of Service). Can be either <code>inherit</code> (the outer header inherits the value of the inner header) or an hexadecimal value starting with <code>0x</code> (optional)."));
+ o = s.taboption('advanced', form.Value, 'tos', _("Override TOS"), _("Specify a TOS (Type of Service). Can be <code>inherit</code> (the outer header inherits the value of the inner header) or an hexadecimal value <code>00..FF</code> (optional)."));
o.optional = true;
o.validate = function(section_id, value) {
- if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,2}$/) && !value.match(/^inherit$/i))
- return _('Invalid value');
+ if (value.length > 0 && !value.match(/^[a-f0-9]{1,2}$/i) && !value.match(/^inherit$/i))
+ return _("Invalid TOS value, expected 00..FF or inherit");
return true;
};
@@ -79,11 +86,14 @@ return network.registerProtocol('gre', {
o = s.taboption('advanced', form.Flag, 'nohostroute', _("No host route"), _("Do not create host route to peer (optional)."));
o.optional = true;
+ o = s.taboption('advanced', form.Flag, 'multicast', _("Multicast"), _("Enable support for multicast traffic (optional)."));
+ o.optional = true;
+
o = s.taboption('advanced', form.Value, 'ikey', _("Incoming key"), _("Key for incoming packets (optional)."));
o.optional = true;
o.datatype = 'integer';
- o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optinal)."));
+ o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optional)."));
o.optional = true;
o.datatype = 'integer';
diff --git a/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js b/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js
index 426b5d98df..e1e9c8c39c 100644
--- a/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js
+++ b/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/gretap.js
@@ -46,6 +46,13 @@ return network.registerProtocol('gretap', {
o = s.taboption('general', form.Value, 'ipaddr', _("Local IPv4 address"), _("The local IPv4 address over which the tunnel is created (optional)."));
o.optional = true;
o.datatype = 'ip4addr("nomask")';
+ o.load = function(section_id) {
+ return network.getWANNetworks().then(L.bind(function(nets) {
+ if (nets.length)
+ this.placeholder = nets[0].getIPAddr();
+ return form.Value.prototype.load.apply(this, [section_id]);
+ }, this));
+ };
o = s.taboption('general', widgets.NetworkSelect, 'network', _("Network interface"), _("Logical network to which the tunnel will be added (bridged) (optional)."));
o.exclude = s.section;
@@ -69,11 +76,11 @@ return network.registerProtocol('gretap', {
o.placeholder = 64;
o.datatype = 'min(1)';
- o = s.taboption('advanced', form.Value, 'tos', _('Override TOS'), _("Specify a TOS (Type of Service). Can be either <code>inherit</code> (the outer header inherits the value of the inner header) or an hexadecimal value starting with <code>0x</code> (optional)."));
+ o = s.taboption('advanced', form.Value, 'tos', _("Override TOS"), _("Specify a TOS (Type of Service). Can be <code>inherit</code> (the outer header inherits the value of the inner header) or an hexadecimal value <code>00..FF</code> (optional)."));
o.optional = true;
o.validate = function(section_id, value) {
- if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,2}$/) && !value.match(/^inherit$/i))
- return _('Invalid value');
+ if (value.length > 0 && !value.match(/^[a-f0-9]{1,2}$/i) && !value.match(/^inherit$/i))
+ return _("Invalid TOS value, expected 00..FF or inherit");
return true;
};
@@ -84,11 +91,14 @@ return network.registerProtocol('gretap', {
o = s.taboption('advanced', form.Flag, 'nohostroute', _("No host route"), _("Do not create host route to peer (optional)."));
o.optional = true;
+ o = s.taboption('advanced', form.Flag, 'multicast', _("Multicast"), _("Enable support for multicast traffic (optional)."));
+ o.optional = true;
+
o = s.taboption('advanced', form.Value, 'ikey', _("Incoming key"), _("Key for incoming packets (optional)."));
o.optional = true;
o.datatype = 'integer';
- o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optinal)."));
+ o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optional)."));
o.optional = true;
o.datatype = 'integer';
diff --git a/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js b/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js
index bd9a43e27b..97b84754ff 100644
--- a/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js
+++ b/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6.js
@@ -46,6 +46,13 @@ return network.registerProtocol('grev6', {
o = s.taboption('general', form.Value, 'ip6addr', _("Local IPv6 address"), _("The local IPv6 address over which the tunnel is created (optional)."));
o.optional = true;
o.datatype = 'ip6addr("nomask")';
+ o.load = function(section_id) {
+ return network.getWAN6Networks().then(L.bind(function(nets) {
+ if (Array.isArray(nets) && nets.length)
+ this.placeholder = nets[0].getIP6Addr();
+ return form.Value.prototype.load.apply(this, [section_id]);
+ }, this));
+ };
o = s.taboption('general', widgets.NetworkSelect, 'weakif', _("Source interface"), _("Logical network from which to select the local endpoint if local IPv6 address is empty and no WAN IPv6 is available (optional)."));
o.exclude = s.section;
@@ -69,11 +76,11 @@ return network.registerProtocol('grev6', {
o.placeholder = 64;
o.datatype = 'min(1)';
- o = s.taboption('advanced', form.Value, 'tos', _('Traffic Class'), _("Specify a Traffic Class. Can be either <code>inherit</code> (the outer header inherits the value of the inner header) or an hexadecimal value starting with <code>0x</code> (optional)."));
+ o = s.taboption('advanced', form.Value, 'tos', _("Traffic Class"), _("Specify a TOS (Type of Service). Can be <code>inherit</code> (the outer header inherits the value of the inner header) or an hexadecimal value <code>00..FF</code> (optional)."));
o.optional = true;
o.validate = function(section_id, value) {
- if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,2}$/) && !value.match(/^inherit$/i))
- return _('Invalid value');
+ if (value.length > 0 && !value.match(/^[a-f0-9]{1,2}$/i) && !value.match(/^inherit$/i))
+ return _("Invalid Traffic Class value, expected 00..FF or inherit");
return true;
};
@@ -81,11 +88,14 @@ return network.registerProtocol('grev6', {
o = s.taboption('advanced', form.Flag, 'nohostroute', _("No host route"), _("Do not create host route to peer (optional)."));
o.optional = true;
+ o = s.taboption('advanced', form.Flag, 'multicast', _("Multicast"), _("Enable support for multicast traffic (optional)."));
+ o.optional = true;
+
o = s.taboption('advanced', form.Value, 'ikey', _("Incoming key"), _("Key for incoming packets (optional)."));
o.optional = true;
o.datatype = 'integer';
- o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optinal)."));
+ o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optional)."));
o.optional = true;
o.datatype = 'integer';
diff --git a/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js b/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js
index 3b1a503719..6203f83557 100644
--- a/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js
+++ b/protocols/luci-proto-gre/htdocs/luci-static/resources/protocol/grev6tap.js
@@ -42,6 +42,13 @@ return network.registerProtocol('grev6tap', {
o = s.taboption('general', form.Value, 'peer6addr', _("Remote IPv6 address or FQDN"), _("The IPv6 address or the fully-qualified domain name of the remote tunnel end."));
o.optional = false;
o.datatype = 'or(hostname,ip6addr("nomask"))';
+ o.load = function(section_id) {
+ return network.getWAN6Networks().then(L.bind(function(nets) {
+ if (Array.isArray(nets) && nets.length)
+ this.placeholder = nets[0].getIP6Addr();
+ return form.Value.prototype.load.apply(this, [section_id]);
+ }, this));
+ };
o = s.taboption('general', form.Value, 'ip6addr', _("Local IPv6 address"), _("The local IPv6 address over which the tunnel is created (optional)."));
o.optional = true;
@@ -74,11 +81,11 @@ return network.registerProtocol('grev6tap', {
o.placeholder = 64;
o.datatype = 'min(1)';
- o = s.taboption('advanced', form.Value, 'tos', _('Traffic Class'), _("Specify a Traffic Class. Can be either <code>inherit</code> (the outer header inherits the value of the inner header) or an hexadecimal value starting with <code>0x</code> (optional)."));
+ o = s.taboption('advanced', form.Value, 'tos', _("Traffic Class"), _("Specify a Traffic Class. Can be <code>inherit</code> (the outer header inherits the value of the inner header) or an hexadecimal value <code>00..FF</code> (optional)."));
o.optional = true;
o.validate = function(section_id, value) {
- if (value.length > 0 && !value.match(/^0x[a-fA-F0-9]{1,2}$/) && !value.match(/^inherit$/i))
- return _('Invalid value');
+ if (value.length > 0 && !value.match(/^[a-f0-9]{1,2}$/i) && !value.match(/^inherit$/i))
+ return _("Invalid Traffic Class value, expected 00..FF or inherit");
return true;
};
@@ -86,11 +93,14 @@ return network.registerProtocol('grev6tap', {
o = s.taboption('advanced', form.Flag, 'nohostroute', _("No host route"), _("Do not create host route to peer (optional)."));
o.optional = true;
+ o = s.taboption('advanced', form.Flag, 'multicast', _("Multicast"), _("Enable support for multicast traffic (optional)."));
+ o.optional = true;
+
o = s.taboption('advanced', form.Value, 'ikey', _("Incoming key"), _("Key for incoming packets (optional)."));
o.optional = true;
o.datatype = 'integer';
- o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optinal)."));
+ o = s.taboption('advanced', form.Value, 'okey', _("Outgoing key"), _("Key for outgoing packets (optional)."));
o.optional = true;
o.datatype = 'integer';