* 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 766d87da2f526a62b37363dd06cbc948bab61e54..c8f1007ff2407135e2e59ef52b203118d14b59a7 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 fb83916781885ab03022395b7410fd883cd5148f..35f54235795b02a650c81cc46ec4fde3476d1da0 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")