modules/admin-{mini,full}: rename "mode" to "hwmode"
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_network / hosts.lua
1 --[[
2 LuCI - Lua Configuration Interface
3
4 Copyright 2008 Steven Barth <steven@midlink.org>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13 ]]--
14
15 require("luci.sys")
16 require("luci.util")
17 m = Map("luci_hosts", translate("hostnames"))
18
19 s = m:section(TypedSection, "host", translate("hostnames_entries"))
20 s.addremove = true
21 s.anonymous = true
22 s.template = "cbi/tblsection"
23
24 hn = s:option(Value, "hostname", translate("hostnames_hostname"))
25 ip = s:option(Value, "ipaddr", translate("hostnames_address"))
26 for i, dataset in ipairs(luci.sys.net.arptable()) do
27 ip:value(
28 dataset["IP address"],
29 "%s (%s)" %{ dataset["IP address"], dataset["HW address"] }
30 )
31 end
32
33 return m