From: Enrique Giraldo Date: Tue, 18 Sep 2018 11:43:01 +0000 (+0200) Subject: luci-mod-admin-full: add dependency for channel auto X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=refs%2Fpull%2F2687%2Fhead;p=oweals%2Fluci.git luci-mod-admin-full: add dependency for channel auto Do not show 'auto' channel option if hostapd is not compiled with CONFIG_ACS Signed-off-by: Enrique Giraldo --- diff --git a/modules/luci-base/luasrc/view/cbi/wireless_modefreq.htm b/modules/luci-base/luasrc/view/cbi/wireless_modefreq.htm index ebb02e489..eeb1d5c5c 100644 --- a/modules/luci-base/luasrc/view/cbi/wireless_modefreq.htm +++ b/modules/luci-base/luasrc/view/cbi/wireless_modefreq.htm @@ -4,6 +4,7 @@ var freqlist = <%= luci.http.write_json(self.iwinfo.freqlist) %>; var hwmodes = <%= luci.http.write_json(self.iwinfo.hwmodelist or {}) %>; var htmodes = <%= luci.http.write_json(self.iwinfo.htmodelist) %>; + var acs = <%= luci.http.write_json(self.hostapd_acs or 0) %>; var channels = { '11g': [ @@ -14,6 +15,10 @@ ] }; + if (acs < 1) { + channels[(freqlist[freqlist.length - 1].mhz > 2484) ? '11a' : '11g'].length = 0; + } + for (var i = 0; i < freqlist.length; i++) channels[(freqlist[i].mhz > 2484) ? '11a' : '11g'].push( freqlist[i].channel, diff --git a/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua b/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua index 7b7fc0ffc..6cf4bdd24 100644 --- a/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua +++ b/modules/luci-mod-network/luasrc/model/cbi/admin_network/wifi.lua @@ -177,6 +177,7 @@ if found_sta then else ch = s:taboption("general", Value, "_mode_freq", '
'..translate("Operating frequency")) ch.iwinfo = iw + ch.hostapd_acs = (os.execute("hostapd -vacs >/dev/null 2>/dev/null") == 0) ch.template = "cbi/wireless_modefreq" function ch.cfgvalue(self, section)