diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-05-13 18:42:53 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-05-13 18:42:53 +0000 |
commit | 98996e380a7301ec5127de83e047d0bf8cf3df43 (patch) | |
tree | c622ac0ec843511e22dead730219517a7359d46c /modules/admin-full/luasrc | |
parent | 750a6910ed31451b88f8958c3982113d22c9de79 (diff) |
libs/sys: implement luci.sys.wifi.channels()
modules/admin-full: only display available channels
Diffstat (limited to 'modules/admin-full/luasrc')
-rw-r--r-- | modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua b/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua index 678386678f..43bff5d527 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua @@ -39,19 +39,9 @@ local hwtype = m:get(arg[1], "type") local nsantenna = m:get(arg[1], "antenna") ch = s:option(Value, "channel", translate("a_w_channel")) -for i=1, 14 do - ch:value(i, i .. " (2.4 GHz)") +for c, f in luci.util.kspairs(luci.sys.wifi.channels()) do + ch:value(c, "%i (%.3f GHz)" %{ c, f }) end -for i=36, 64, 4 do - ch:value(i, i .. " (5 GHz)") -end -for i=100, 140, 4 do - ch:value(i, i .. " (5 GHz)") -end -ch:value(147, 147 .. " (5 GHz)") -ch:value(151, 151 .. " (5 GHz)") -ch:value(155, 155 .. " (5 GHz)") -ch:value(167, 167 .. " (5 GHz)") s:option(Value, "txpower", translate("a_w_txpwr"), "dBm").rmempty = true |