4ec81b068f88170445c5e9e2c44f35eb35d6f236
[project/luci2/ui.git] / luci2 / htdocs / luci2 / proto / 6to4.js
1 L.NetworkModel.Protocol.extend({
2         protocol:    '6to4',
3         description: L.tr('IPv6-over-IPv4 (6to4)'),
4         tunnel:      true,
5         virtual:     true,
6
7         populateForm: function(section, iface)
8         {
9                 section.taboption('general', L.cbi.InputValue, 'ipaddr', {
10                         caption:     L.tr('Local IPv4 address'),
11                         description: L.tr('Leave empty to use the current WAN address'),
12                         datatype:    'ip4addr',
13                         optional:    true
14                 }).load = function() {
15                         var wan = L.NetworkModel.findWAN();
16                         if (wan)
17                                 this.options.placeholder = wan.getIPv4Addrs()[0];
18                 };
19
20                 section.taboption('advanced', L.cbi.CheckboxValue, 'defaultroute', {
21                         caption:     L.tr('Default route'),
22                         description: L.tr('Create IPv6 default route via tunnel'),
23                         optional:    true,
24                         initial:     true
25                 });
26
27                 section.taboption('advanced', L.cbi.InputValue, 'ttl', {
28                         caption:     L.tr('Override TTL'),
29                         description: L.tr('Specifies the Time-to-Live on the tunnel interface'),
30                         datatype:    'range(1,255)',
31                         placeholder: 64,
32                         optional:    true
33                 });
34         }
35 });