luci-mod-admin-full: automatically set dns=1 for static leases with hostname
Most users likely want the hostname of a static DHCP lease to be resolveable, even if the corresponding host is currently offline. Adjust the form logic to automatically set 'option dns 1' whenever a name is specified in the static lease entry. FIxes LEDE FS#815. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
parent
a6054eb38a
commit
7f6fc1681f
1 changed files with 10 additions and 0 deletions
|
@ -275,6 +275,16 @@ name = s:option(Value, "name", translate("Hostname"))
|
|||
name.datatype = "hostname"
|
||||
name.rmempty = true
|
||||
|
||||
function name.write(self, section, value)
|
||||
Value.write(self, section, value)
|
||||
m:set(section, "dns", "1")
|
||||
end
|
||||
|
||||
function name.remove(self, section)
|
||||
Value.remove(self, section)
|
||||
m:del(section, "dns")
|
||||
end
|
||||
|
||||
mac = s:option(Value, "mac", translate("<abbr title=\"Media Access Control\">MAC</abbr>-Address"))
|
||||
mac.datatype = "list(macaddr)"
|
||||
mac.rmempty = true
|
||||
|
|
Loading…
Reference in a new issue