2dab0d9908a27370ced1516852ba5f3de89deb4f
[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             caption:     function(sid) { return sid ? (this.fields.name.textvalue(sid) || L.tr('Unnamed LED')) : '' },
12             teasers:     [ 'sysfs', 'default', 'trigger', '_net_dev', 'mode', '_usb_dev', 'delayon', 'delayoff' ],
13             collabsible: true,
14             addremove:   true,
15             add_caption: L.tr('Add new hostname'),
16             remove_caption: L.tr('Remove hostname')
17         });
18
19         s.option(L.cbi.InputValue, 'name', {
20             caption:     L.tr('Hostname'),
21             datatype:    'hostname'
22         });
23
24         s.option(L.cbi.InputValue, 'ip', {
25             caption:     L.tr('IP address'),
26             datatype:    'ipaddr'
27         });
28
29         return m.insertInto('#map');
30     }
31 });