modules/admin-full: add field validation for hostnames in leases and hosts pages
This commit is contained in:
parent
02a67572f8
commit
3e16965106
2 changed files with 8 additions and 0 deletions
|
@ -31,6 +31,8 @@ s.anonymous = true
|
||||||
s.template = "cbi/tblsection"
|
s.template = "cbi/tblsection"
|
||||||
|
|
||||||
name = s:option(Value, "name", translate("Hostname"))
|
name = s:option(Value, "name", translate("Hostname"))
|
||||||
|
name.datatype = "hostname"
|
||||||
|
name.rmempty = true
|
||||||
|
|
||||||
mac = s:option(Value, "mac", translate("<abbr title=\"Media Access Control\">MAC</abbr>-Address"))
|
mac = s:option(Value, "mac", translate("<abbr title=\"Media Access Control\">MAC</abbr>-Address"))
|
||||||
mac.datatype = "macaddr"
|
mac.datatype = "macaddr"
|
||||||
|
|
|
@ -23,7 +23,13 @@ s.anonymous = true
|
||||||
s.template = "cbi/tblsection"
|
s.template = "cbi/tblsection"
|
||||||
|
|
||||||
hn = s:option(Value, "name", translate("Hostname"))
|
hn = s:option(Value, "name", translate("Hostname"))
|
||||||
|
hn.datatype = "hostname"
|
||||||
|
hn.rmempty = true
|
||||||
|
|
||||||
ip = s:option(Value, "ip", translate("IP address"))
|
ip = s:option(Value, "ip", translate("IP address"))
|
||||||
|
ip.datatype = "ipaddr"
|
||||||
|
ip.rmempty = true
|
||||||
|
|
||||||
for i, dataset in ipairs(luci.sys.net.arptable()) do
|
for i, dataset in ipairs(luci.sys.net.arptable()) do
|
||||||
ip:value(
|
ip:value(
|
||||||
dataset["IP address"],
|
dataset["IP address"],
|
||||||
|
|
Loading…
Reference in a new issue