* Fixed DHCP configuration for devices without WAN interface
authorSteven Barth <steven@midlink.org>
Thu, 1 May 2008 12:33:27 +0000 (12:33 +0000)
committerSteven Barth <steven@midlink.org>
Thu, 1 May 2008 12:33:27 +0000 (12:33 +0000)
* Made interface selector for route configuration a ListValue

module/admin-core/src/model/cbi/admin_network/dhcp.lua
module/admin-core/src/model/cbi/admin_network/routes.lua

index 766d87d..c8f1007 100644 (file)
@@ -13,6 +13,7 @@ iface = s:option(ListValue, "interface", "Schnittstelle")
 for k, v in pairs(ffluci.model.uci.show("network").network) do
        if v[".type"] == "interface" and k ~= "loopback" then
                iface:value(k)
+               s:depends("interface", k) -- Only change sections with existing interfaces
        end
 end
 
index fb83916..35f5423 100644 (file)
@@ -7,7 +7,12 @@ s = m:section(TypedSection, "route")
 s.addremove = true
 s.anonymous = true
 
-s:option(Value, "interface", "Schnittstelle")
+iface = s:option(ListValue, "interface", "Schnittstelle")
+for k, v in pairs(ffluci.model.uci.show("network").network) do
+       if v[".type"] == "interface" and k ~= "loopback" then
+               iface:value(k)
+       end
+end
 
 s:option(Value, "target", "Ziel", "Host-IP oder Netzwerk")