modules/admin-full: Display wifi devices as enabled if user removes the disabled...
[project/luci.git] / modules / admin-full / luasrc / model / cbi / admin_network / dhcp.lua
index e9ab6c9..20adcdf 100644 (file)
@@ -24,6 +24,7 @@ iface = s:option(ListValue, "interface", translate("interface"))
 luci.model.uci.foreach("network", "interface",
        function (section)
                if section[".name"] ~= "loopback" then
 luci.model.uci.foreach("network", "interface",
        function (section)
                if section[".name"] ~= "loopback" then
+                       iface.default = iface.default or section[".name"]
                        iface:value(section[".name"])
                        s:depends("interface", section[".name"])
                end
                        iface:value(section[".name"])
                        s:depends("interface", section[".name"])
                end
@@ -57,8 +58,13 @@ s.addremove = true
 s.anonymous = true
 s.template = "cbi/tblsection"
 
 s.anonymous = true
 s.template = "cbi/tblsection"
 
-s:option(Value, "macaddr", translate("macaddress"))
-s:option(Value, "ipaddr", translate("ipaddress"))
+mac = s:option(Value, "macaddr", translate("macaddress"))
+ip = s:option(Value, "ipaddr", translate("ipaddress"))
+for i, dataset in ipairs(luci.sys.net.arptable()) do
+       ip:value(dataset["IP address"])
+       mac:value(dataset["HW address"],
+        dataset["HW address"] .. " (" .. dataset["IP address"] .. ")")
+end
 
        
 
        
-return m, m2
\ No newline at end of file
+return m, m2