luci-base: add default value options dhcp hostname

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
Florian Eckert 2020-09-16 17:16:39 +02:00
parent 9da9777a94
commit fd75c2b7c5

View file

@ -20,6 +20,9 @@ return network.registerProtocol('dhcp', {
var dev = this.getL2Device() || this.getDevice(), o; var dev = this.getL2Device() || this.getDevice(), o;
o = s.taboption('general', form.Value, 'hostname', _('Hostname to send when requesting DHCP')); o = s.taboption('general', form.Value, 'hostname', _('Hostname to send when requesting DHCP'));
o.default = '';
o.value('', 'Send the hostname of this device');
o.value('*', 'Do not send a hostname');
o.datatype = 'or(hostname, "*")'; o.datatype = 'or(hostname, "*")';
o.load = function(section_id) { o.load = function(section_id) {
return callFileRead('/proc/sys/kernel/hostname').then(L.bind(function(hostname) { return callFileRead('/proc/sys/kernel/hostname').then(L.bind(function(hostname) {