Changeset 6775
- Timestamp:
- 01/21/11 00:26:49 (2 years ago)
- Location:
- luci/trunk/modules/admin-full/luasrc/model/cbi/admin_network
- Files:
-
- 2 modified
-
wifi.lua (modified) (9 diffs)
-
wifi_add.lua (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
luci/trunk/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua
r6704 r6775 18 18 19 19 arg[1] = arg[1] or "" 20 arg[2] = arg[2] or ""21 20 22 21 m = Map("wireless", "", … … 31 30 32 31 function m.on_commit(map) 33 local wnet = nw:get_wifinet(arg[ 2])32 local wnet = nw:get_wifinet(arg[1]) 34 33 if ifsection and wnet then 35 34 ifsection.section = wnet.sid 36 m.title = wnet:get_i18n()35 m.title = luci.util.pcdata(wnet:get_i18n()) 37 36 end 38 37 end … … 40 39 nw.init(m.uci) 41 40 42 local wnet = nw:get_wifinet(arg[2]) 41 local wnet = nw:get_wifinet(arg[1]) 42 local wdev = wnet and wnet:get_device() 43 43 44 44 -- redirect to overview page if network does not exist anymore (e.g. after a revert) 45 if not wnet then45 if not wnet or not wdev then 46 46 luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless")) 47 47 return 48 48 end 49 49 50 m.title = wnet:get_i18n()50 m.title = luci.util.pcdata(wnet:get_i18n()) 51 51 52 52 … … 56 56 57 57 58 s = m:section(NamedSection, arg[1], "wifi-device", translate("Device Configuration"))58 s = m:section(NamedSection, wdev:name(), "wifi-device", translate("Device Configuration")) 59 59 s.addremove = false 60 60 … … 71 71 st = s:taboption("general", DummyValue, "__status", translate("Status")) 72 72 st.template = "admin_network/wifi_status" 73 st.ifname = arg[ 2]73 st.ifname = arg[1] 74 74 75 75 en = s:taboption("general", Flag, "disabled", translate("Enable device")) … … 83 83 84 84 85 local hwtype = m:get(arg[1],"type")86 local htcaps = m:get(arg[1],"ht_capab") and true or false85 local hwtype = wdev:get("type") 86 local htcaps = wdev:get("ht_capab") and true or false 87 87 88 88 -- NanoFoo 89 local nsantenna = m:get(arg[1],"antenna")89 local nsantenna = wdev:get("antenna") 90 90 91 91 ch = s:taboption("general", Value, "channel", translate("Channel")) … … 277 277 s.addremove = false 278 278 s.anonymous = true 279 s.defaults.device = arg[1]279 s.defaults.device = wdev:name() 280 280 281 281 s:tab("general", translate("General Setup")) … … 634 634 return 1 635 635 end 636 return slot 636 return slot 637 637 end 638 638 … … 649 649 wepkey.rmempty = true 650 650 wepkey.password = true 651 651 652 652 function wepkey.write(self, section, value) 653 653 if value and (#value == 5 or #value == 13) then -
luci/trunk/modules/admin-full/luasrc/model/cbi/admin_network/wifi_add.lua
r6534 r6775 167 167 uci:save("firewall") 168 168 169 luci.http.redirect(luci.dispatcher.build_url( 170 "admin/network/wireless", wdev:name(), wnet:ifname() 171 )) 169 luci.http.redirect(wnet:adminlink()) 172 170 end 173 171 end
