luci2: move most RPC proxy function declarations into the views using them to reduce...
[project/luci2/ui.git] / luci2 / htdocs / luci2 / view / network.hosts.js
1 L.ui.view.extend({
2 title: L.tr('Hostnames'),
3 description: L.tr('Manage static host records to let the local DNS server resolve certain names to specific IP addresses.'),
4
5 execute: function() {
6 var m = new L.cbi.Map('dhcp', {
7 readonly: !this.options.acls.hostnames
8 });
9
10 var s = m.section(L.cbi.TableSection, 'domain', {
11 anonymous: true,
12 addremove: true,
13 add_caption: L.tr('Add new hostname'),
14 remove_caption: L.tr('Remove hostname')
15 });
16
17 s.option(L.cbi.InputValue, 'name', {
18 caption: L.tr('Hostname'),
19 datatype: 'hostname'
20 });
21
22 s.option(L.cbi.InputValue, 'ip', {
23 caption: L.tr('IP address'),
24 datatype: 'ipaddr'
25 });
26
27 return m.insertInto('#map');
28 }
29 });