modules/admin-full: change workflow of wifi config page; display only one network (choosen in wifi overview) and add a hook for section remapping
on uci commit
This commit is contained in:
parent
66fe827403
commit
2a1f1a1d7b
1 changed files with 305 additions and 285 deletions
|
@ -14,6 +14,7 @@ $Id$
|
|||
|
||||
local wa = require "luci.tools.webadmin"
|
||||
local nw = require "luci.model.network"
|
||||
local ww = require "luci.model.wireless"
|
||||
local fs = require "nixio.fs"
|
||||
|
||||
arg[1] = arg[1] or ""
|
||||
|
@ -21,7 +22,22 @@ arg[2] = arg[2] or ""
|
|||
|
||||
m = Map("wireless", translate("networks"), translate("a_w_networks1"))
|
||||
m:chain("network")
|
||||
|
||||
local ifsection
|
||||
|
||||
function m.on_commit(map)
|
||||
nw.init(map.uci)
|
||||
ww.init(map.uci)
|
||||
|
||||
local wnet = ww:get_network(arg[2])
|
||||
if ifsection and wnet then
|
||||
ifsection.section = wnet.sid
|
||||
end
|
||||
end
|
||||
|
||||
nw.init(m.uci)
|
||||
ww.init(m.uci)
|
||||
|
||||
|
||||
local iw = nil
|
||||
local tx_powers = nil
|
||||
|
@ -201,7 +217,11 @@ end
|
|||
|
||||
----------------------- Interface -----------------------
|
||||
|
||||
s = m:section(NamedSection, arg[2], "wifi-iface", translate("interfaces"))
|
||||
local wnet = ww:get_network(arg[2])
|
||||
|
||||
if wnet then
|
||||
s = m:section(NamedSection, wnet.sid, "wifi-iface", ww:get_i18n(wnet))
|
||||
ifsection = s
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
s.defaults.device = arg[1]
|
||||
|
@ -527,6 +547,6 @@ if hwtype == "atheros" or hwtype == "mac80211" or hwtype == "prism2" then
|
|||
password:depends({mode="sta", eap_type="TTLS", encryption="wpa2"})
|
||||
password:depends({mode="sta", eap_type="TTLS", encryption="wpa"})
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
return m
|
||||
|
|
Loading…
Reference in a new issue