summaryrefslogtreecommitdiffhomepage
path: root/modules
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-07 19:03:25 +0000
committerSteven Barth <steven@midlink.org>2008-08-07 19:03:25 +0000
commite72a526984982f6fa2b6f2ed5ce01523094bfe43 (patch)
tree2f34fbbe1e21e58d9292fd13305c834cb0613b17 /modules
parentd79794c1194c65861253e20681fabe103cc85740 (diff)
libs/cbi: Added magic ;-)
Diffstat (limited to 'modules')
-rw-r--r--modules/admin-full/luasrc/controller/admin/network.lua14
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua10
2 files changed, 21 insertions, 3 deletions
diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua
index 871263334..3fb45f804 100644
--- a/modules/admin-full/luasrc/controller/admin/network.lua
+++ b/modules/admin-full/luasrc/controller/admin/network.lua
@@ -15,6 +15,7 @@ module("luci.controller.admin.network", package.seeall)
function index()
require("luci.i18n")
+ require("luci.model.uci")
local i18n = luci.i18n.translate
local page = node("admin", "network")
@@ -31,7 +32,18 @@ function index()
page.target = cbi("admin_network/ifaces")
page.title = i18n("interfaces", "Schnittstellen")
page.order = 20
-
+ page.leaf = true
+
+ luci.model.uci.foreach("network", "interface",
+ function (section)
+ local ifc = section[".name"]
+ if ifc ~= "loopback" then
+ entry({"admin", "network", "ifaces", ifc}, page.target, ifc)
+ end
+ end
+ )
+
+
local page = node("admin", "network", "dhcp")
page.target = cbi("admin_network/dhcp")
page.title = "DHCP"
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
index 014de7ddf..bea425d72 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
@@ -14,8 +14,14 @@ $Id$
m = Map("network", translate("interfaces"), translate("a_n_ifaces1"))
s = m:section(TypedSection, "interface", "")
-s.addremove = true
-s:exclude("loopback")
+function s.filter(section)
+ return section ~= "loopback" and (not arg or #arg == 0 or
+ luci.util.contains(arg, section))
+end
+
+if not arg or #arg == 0 then
+ s.addremove = true
+end
s:depends("proto", "static")
s:depends("proto", "dhcp")