luci2: implement Class.require() and Class.instantiate()
[project/luci2/ui.git] / luci2 / htdocs / luci2 / proto / dhcpv6.js
1 L.NetworkModel.Protocol.extend({
2         protocol:    'dhcpv6',
3         description: L.tr('DHCPv6 client / IPv6 autoconfig'),
4         tunnel:      false,
5         virtual:     false,
6
7         populateForm: function(section, iface)
8         {
9                 section.taboption('general', L.cbi.ListValue, 'reqaddress', {
10                         caption:     L.tr('Request IPv6 address'),
11                         initial:     'try'
12                 }).value('try',   L.tr('Attempt DHCPv6, fallback to RA'))
13                   .value('force', L.tr('Force DHCPv6'))
14                   .value('none',  L.tr('RA only'));
15
16                 section.taboption('general', L.cbi.ComboBox, 'reqprefix', {
17                         caption:      L.tr('Request IPv6 prefix'),
18                         description:  L.tr('Specifies the requested prefix length'),
19                         initial:      'auto',
20                         datatype:     'or("auto", "no", range(32, 64))'
21                 }).value('auto',   L.tr('automatic'))
22                   .value('no',     L.tr('disabled'))
23                   .value('48').value('52').value('56').value('60').value('64');
24
25                 section.taboption('general', L.cbi.InputValue, 'ip6prefix', {
26                         caption:     L.tr('Custom prefix'),
27                         description: L.tr('Specifies an additional custom IPv6 prefix for distribution to clients'),
28                         datatype:    'ip6addr',
29                         optional:    true
30                 });
31
32                 section.taboption('advanced', L.cbi.CheckboxValue, 'defaultroute', {
33                         caption:     L.tr('Default route'),
34                         description: L.tr('Create IPv6 default route via tunnel'),
35                         optional:    true,
36                         initial:     true
37                 });
38
39                 section.taboption('advanced', L.cbi.CheckboxValue, 'peerdns', {
40                         caption:     L.tr('Use DNS'),
41                         description: L.tr('Use DNS servers advertised by DHCPv6'),
42                         optional:    true,
43                         initial:     true
44                 });
45
46                 section.taboption('advanced', L.cbi.DynamicList, 'dns', {
47                         caption:     L.tr('Custom DNS'),
48                         description: L.tr('Use custom DNS servers instead of DHCPv6 ones'),
49                         datatype:    'ipaddr',
50                         optional:    true
51                 }).depends('peerdns', false);
52
53                 section.taboption('advanced', L.cbi.InputValue, 'clientid', {
54                         caption:     L.tr('Client ID'),
55                         description: L.tr('Client ID to send when requesting DHCPv6'),
56                         optional:    true
57                 });
58         }
59 });