projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
modules/admin-full: Preparing rewrite of network interface configuration
[project/luci.git]
/
modules
/
admin-full
/
luasrc
/
model
/
cbi
/
admin_network
/
ifaces.lua
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 dc50fdc94f179878892d657eabf695e47340200a..c85b6a182169183587cb64f23d2deaeaaeccac74 100644
(file)
--- a/
modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
+++ b/
modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua
@@
-13,7
+13,17
@@
$Id$
]]--
m = Map("network", translate("interfaces"), translate("a_n_ifaces1"))
]]--
m = Map("network", translate("interfaces"), translate("a_n_ifaces1"))
+arg = arg or {}
+
s = m:section(TypedSection, "interface", translate("interfaces"))
s = m:section(TypedSection, "interface", translate("interfaces"))
+function s.create(self, section)
+ local stat = TypedSection.create(self, section)
+ if stat then
+ arg = {section or stat}
+ end
+ return stat
+end
+
function s.filter(self, section)
return section ~= "loopback" and
(not arg or not arg[1] or arg[1] == section)
function s.filter(self, section)
return section ~= "loopback" and
(not arg or not arg[1] or arg[1] == section)
@@
-87,7
+97,7
@@
mac.optional = true
s2 = m:section(TypedSection, "alias", translate("aliases"))
s2.addremove = true
s2 = m:section(TypedSection, "alias", translate("aliases"))
s2.addremove = true
-if arg and arg[1]
and luci.model.uci.get("network", arg[1])
then
+if arg and arg[1] then
s2:depends("interface", arg[1])
s2.defaults.interface = arg[1]
else
s2:depends("interface", arg[1])
s2.defaults.interface = arg[1]
else