2008-09-06 18:21:58 +00:00
|
|
|
--[[
|
|
|
|
LuCI - Lua Configuration Interface
|
|
|
|
|
|
|
|
Copyright 2008 Steven Barth <steven@midlink.org>
|
2010-03-08 01:18:22 +00:00
|
|
|
Copyright 2010 Jo-Philipp Wich <xm@subsignal.org>
|
2008-09-06 18:21:58 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
$Id$
|
|
|
|
]]--
|
|
|
|
|
|
|
|
require("luci.sys")
|
|
|
|
require("luci.util")
|
2010-03-08 01:18:22 +00:00
|
|
|
m = Map("dhcp", translate("Hostnames"))
|
2008-09-06 18:21:58 +00:00
|
|
|
|
2010-03-08 01:18:22 +00:00
|
|
|
s = m:section(TypedSection, "domain", translate("Host entries"))
|
2008-09-06 18:21:58 +00:00
|
|
|
s.addremove = true
|
|
|
|
s.anonymous = true
|
|
|
|
s.template = "cbi/tblsection"
|
|
|
|
|
2010-03-08 01:18:22 +00:00
|
|
|
hn = s:option(Value, "name", translate("Hostname"))
|
|
|
|
ip = s:option(Value, "ip", translate("IP address"))
|
2008-09-06 18:21:58 +00:00
|
|
|
for i, dataset in ipairs(luci.sys.net.arptable()) do
|
|
|
|
ip:value(
|
|
|
|
dataset["IP address"],
|
|
|
|
"%s (%s)" %{ dataset["IP address"], dataset["HW address"] }
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
return m
|