From 98996e380a7301ec5127de83e047d0bf8cf3df43 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Wed, 13 May 2009 18:42:53 +0000 Subject: libs/sys: implement luci.sys.wifi.channels() modules/admin-full: only display available channels --- modules/admin-full/luasrc/model/cbi/admin_network/wifi.lua | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'modules/admin-full/luasrc/model/cbi') 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 -- cgit v1.2.3