Changeset 6775

Show
Ignore:
Timestamp:
01/21/11 00:26:49 (2 years ago)
Author:
jow
Message:

modules/admin-full: rework wifi CBI maps

Location:
luci/trunk/modules/admin-full/luasrc/model/cbi/admin_network
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • luci/trunk/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua

    r6704 r6775  
    1818 
    1919arg[1] = arg[1] or "" 
    20 arg[2] = arg[2] or "" 
    2120 
    2221m = Map("wireless", "", 
     
    3130 
    3231function m.on_commit(map) 
    33     local wnet = nw:get_wifinet(arg[2]) 
     32    local wnet = nw:get_wifinet(arg[1]) 
    3433    if ifsection and wnet then 
    3534        ifsection.section = wnet.sid 
    36         m.title = wnet:get_i18n() 
     35        m.title = luci.util.pcdata(wnet:get_i18n()) 
    3736    end 
    3837end 
     
    4039nw.init(m.uci) 
    4140 
    42 local wnet = nw:get_wifinet(arg[2]) 
     41local wnet = nw:get_wifinet(arg[1]) 
     42local wdev = wnet and wnet:get_device() 
    4343 
    4444-- redirect to overview page if network does not exist anymore (e.g. after a revert) 
    45 if not wnet then 
     45if not wnet or not wdev then 
    4646    luci.http.redirect(luci.dispatcher.build_url("admin/network/wireless")) 
    4747    return 
    4848end 
    4949 
    50 m.title = wnet:get_i18n() 
     50m.title = luci.util.pcdata(wnet:get_i18n()) 
    5151 
    5252 
     
    5656 
    5757 
    58 s = m:section(NamedSection, arg[1], "wifi-device", translate("Device Configuration")) 
     58s = m:section(NamedSection, wdev:name(), "wifi-device", translate("Device Configuration")) 
    5959s.addremove = false 
    6060 
     
    7171st = s:taboption("general", DummyValue, "__status", translate("Status")) 
    7272st.template = "admin_network/wifi_status" 
    73 st.ifname   = arg[2] 
     73st.ifname   = arg[1] 
    7474 
    7575en = s:taboption("general", Flag, "disabled", translate("Enable device")) 
     
    8383 
    8484 
    85 local hwtype = m:get(arg[1], "type") 
    86 local htcaps = m:get(arg[1], "ht_capab") and true or false 
     85local hwtype = wdev:get("type") 
     86local htcaps = wdev:get("ht_capab") and true or false 
    8787 
    8888-- NanoFoo 
    89 local nsantenna = m:get(arg[1], "antenna") 
     89local nsantenna = wdev:get("antenna") 
    9090 
    9191ch = s:taboption("general", Value, "channel", translate("Channel")) 
     
    277277s.addremove = false 
    278278s.anonymous = true 
    279 s.defaults.device = arg[1] 
     279s.defaults.device = wdev:name() 
    280280 
    281281s:tab("general", translate("General Setup")) 
     
    634634        return 1 
    635635    end 
    636     return slot      
     636    return slot 
    637637end 
    638638 
     
    649649    wepkey.rmempty = true 
    650650    wepkey.password = true 
    651      
     651 
    652652    function wepkey.write(self, section, value) 
    653653        if value and (#value == 5 or #value == 13) then 
  • luci/trunk/modules/admin-full/luasrc/model/cbi/admin_network/wifi_add.lua

    r6534 r6775  
    167167            uci:save("firewall") 
    168168 
    169             luci.http.redirect(luci.dispatcher.build_url( 
    170                 "admin/network/wireless", wdev:name(), wnet:ifname() 
    171             )) 
     169            luci.http.redirect(wnet:adminlink()) 
    172170        end 
    173171    end