Merge pull request #5193 from zhoreeq/luci_yggdrasil_update
[project/luci.git] / applications / luci-app-yggdrasil / htdocs / luci-static / resources / view / yggdrasil / settings.js
1 'use strict';
2 'require view';
3 'require form';
4
5 return view.extend({
6 render: function() {
7 var m, s, o;
8
9 m = new form.Map('yggdrasil', 'Yggdrasil');
10
11 s = m.section(form.TypedSection, 'yggdrasil', _('General settings'));
12 s.anonymous = true;
13
14 s.option(form.Value, "IfName", _("Yggdrasil's network interface name"));
15
16 s.option(form.Flag, "NodeInfoPrivacy", _("Enable NodeInfo privacy"),
17 _("By default, nodeinfo contains some defaults including the platform," +
18 " architecture and Yggdrasil version. These can help when surveying" +
19 " the network and diagnosing network routing problems. Enabling" +
20 " nodeinfo privacy prevents this, so that only items specified in" +
21 " \"NodeInfo\" are sent back if specified."));
22
23 o = s.option(form.Value, "NodeInfo", _("NodeInfo"),
24 _("Optional node info. This must be a { \"key\": \"value\", ... } map " +
25 "or set as null. This is entirely optional but, if set, is visible " +
26 "to the whole network on request."));
27 o.validate = function(k, v) {
28 try { JSON.parse(v); return true; } catch (e) { return e.message; }
29 }
30
31 s.option(form.Value, "IfMTU", _("MTU size for the interface"));
32
33 o = m.section(form.TableSection, "listen_address", _("Listen addresses"),
34 _("Listen addresses for incoming connections. You will need to add " +
35 "listeners in order to accept incoming peerings from non-local nodes. " +
36 "Multicast peer discovery will work regardless of any listeners set " +
37 "here. Each listener should be specified in URI format as above, e.g. " +
38 "tcp://0.0.0.0:0 or tcp://[::]:0 to listen on all interfaces."));
39 o.option(form.Value, "uri",
40 _("e.g. tcp://0.0.0.0:0 or tcp://[::]:0"));
41 o.anonymous = true;
42 o.addremove = true;
43
44 o = m.section(form.TableSection, "multicast_interface", _("Multicast interface"),
45 _("Configuration for which interfaces multicast peer discovery should be enabled on. " +
46 "Regex is a regular expression which is matched against an interface name, and interfaces use the first configuration that they match gainst. " +
47 "Beacon configures whether or not the node should send link-local multicast beacons to advertise their presence, while listening for incoming connections on Port. " +
48 "Listen controls whether or not the node listens for multicast beacons and opens outgoing connections."));
49 o.option(form.Value, "regex", _("Regular expression"));
50 o.option(form.Flag, "beacon", _("Send beacons"));
51 o.option(form.Flag, "listen", _("Listen for beacons"));
52 o.option(form.Value, "port", _("Link-local port"));
53 o.anonymous = true;
54 o.addremove = true;
55
56 return m.render();
57 }
58 });