<% local uci = require "luci.model.uci".cursor() local ntm = require "luci.model.network".init() local sys = require "luci.sys" local redir_page = 0 local devices = ntm:get_wifidevs() local changes = uci:changes("wireless") local RSSI_THRESHOLD_MAX = uci:get('functionlist','vendorlist','RSSI_THRESHOLD_MAX') or -60 local RSSI_THRESHOLD_MIN = uci:get('functionlist','vendorlist','RSSI_THRESHOLD_MIN') or -100 local JAPAN_COUNTRY_ID if uci:get("functionlist","functionlist","SUPPORT_JAPAN_BANDWIDTH_HT80") == '1' then JAPAN_COUNTRY_ID = 4015 else JAPAN_COUNTRY_ID = 392 end if changes.wireless then for s, c in pairs(changes.wireless) do for option, v in pairs(c) do if option == "obeyregpower" then redir_page = 1 break end end end end local disabled_radio2G = "1" local disabled_radio5G = "1" local disabled_radio52G = "1" uci:foreach("wireless", "wifi-iface", function(s) if s.device == "wifi0" and (s.mode_display == "ap" or (s.mode_display == "wds_ap" and s.nawds == "0")) then if s.disabled == "0" then disabled_radio2G = "0" end end if s.device == "wifi1" and (s.mode_display == "ap" or (s.mode_display == "wds_ap" and s.nawds == "0")) then if s.disabled == "0" then disabled_radio5G = "0" end end if WLAN5G_2=="1" then if s.device == "wifi2" and (s.mode_display == "ap" or (s.mode_display == "wds_ap" and s.nawds == "0")) then if s.disabled == "0" then disabled_radio52G = "0" end end end end) if uci:get('functionlist','functionlist','SUPPORT_REPEATER_MODULE') == '1' then local sta_ap_ap = {} for _, dev in ipairs(devices) do sta_ap_ap[#sta_ap_ap+1] = ntm:get_wifinet_index(dev:name(),"sta_ap",tonumber(1)):name() end end %> <%if redir_page ~= 1 then%> <%if uci:get('functionlist','functionlist','SUPPORT_MYID') == '1' then%> <%+myid%> <%end%> <%+header%> <%end%> <% local radioNum,wifi_dev=0,{} if WLAN24G == '1' then radioNum=radioNum+1 wifi_dev["2.4G"]={"wifi0"} end if WLAN5G == '1' then radioNum=radioNum+1 wifi_dev["5G"]={"wifi1"} if WLAN5G_2=="1" then table.insert(wifi_dev["5G"], "wifi2") end if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] radioNum=radioNum+1 end --[[ #### WLAN5G_2 feature ### --]] end local devs={} devs["2.4G"]={} --[[ record 2.4G radio --]] devs["5G"]={} --[[ record 5G radio --]] local wifi_ap_enable = {} --[[ record if wifi really up --]] local wifi_all_net={} --[[ record the interfaces of the device --]] for _, dev in ipairs(devices) do wifi_all_net[dev:name()] = dev:get_wifinets_all() if filterRadio and dev:name()==filterRadio then else for i, v in pairs(wifi_dev) do for a, b in pairs(v) do if dev:name() == b then table.insert(devs[i], dev:name()) end end end end if dev:name()=="wifi1" or dev:name()=="wifi2" then wifi_ap_enable[dev:name()] = "0" for _, net in ipairs(wifi_all_net[dev:name()]["all"]) do if net:noise() ~= 0 then wifi_ap_enable[dev:name()] = "1" end end end end local arpcache = { } sys.net.arptable(function(e) arpcache[e["HW address"]:upper()] = e["IP address"] end) local opmode_type = {} local ManagementVLANID_MIN_VALUE = tonumber(uci:get("functionlist", "vendorlist", "ManagementVLANID_MIN_VALUE") or 1) local ManagementVLANID_MAX_VALUE = tonumber(uci:get("functionlist", "vendorlist", "ManagementVLANID_MAX_VALUE") or 4094) if uci:get('functionlist','functionlist','SUPPORT_REPEATER_MODULE') == '1' then opmode_type = {[1]="ap",[2]="sta",[3]="wds_ap",[4]="wds_sta",[5]="wds_bridge",[6]="sta_ap"} else opmode_type = {[1]="ap",[2]="sta",[3]="wds_ap",[4]="wds_sta",[5]="wds_bridge"} end --[[ local netlist = { } local netdevs = { } local dev for _, dev in ipairs(devices) do local net for _, net in ipairs(dev:get_wifinets()) do netlist[#netlist+1] = net:id() netdevs[net:id()] = dev:name() end end ]]-- %>

<%=translate("It can facilitate effective spectrum usage, enabling 5GHz-capable clients to associate with AP's 5GHz radio and offloading air utilization in 2.4GHz-band.")%>

<%=translate("The function will automatically steer wireless devices to either the low-band or high-band to assure smooth connection on both bands.")%>

<%:This configuration allows segregate temporary guest WiFi usage with individual SSID, security, and DHCP settings.%>

<%:When a weakening wireless link between Access Point and client is detected below specified RSSI, the AP will encourage client to connect to the surrounding AP with stronger signal.%>

<%:If the feature is enabled with specified VLAN ID, the device will only allow management access with the same specified VLAN ID.%>

<%:This is to specify threshold packet size for RTS/CTS; a small number may cause RTS/CTS frames to be sent more often and consume more bandwidth.%>

<%:For enhanced transmit efficiency, it can merge multiple data frames upon specified number of frames or bytes into one aggregated frame for transmission on 2.4GHz.%>

<%:Block the communication between the associated clients under the same WLAN.%>

<%:When this option is checked with specified VLAN ID in a SSID profile, the traffics from this SSID will be tagged with this VLAN ID upon entering LAN bridge.%>

<%:Unicast conversion method allows a WLAN AP to have a direct relationship with each client to transmit original multicast-like traffics on a one-to-one basis, establishing individual sessions between the transmission server and each client. This method will add additional bandwidth overhead on the unicast server upon each additional client.%>

<%:Multicast transmission is a one-to-many group communication methodology in which a WLAN AP forwards all broadcast traffics from a multicast source to a client subnet where multiple client devices are listening.%>

<% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 START ### --]] %> <% else %> <% end %> <% if uci:get('functionlist','functionlist', 'SUPPORT_MIN_RATE_SETTING') == '1' then%>

<%:Data frames will be sent out at the lowest selected rate. Client devices must use either the lowest selected rate or a faster one.%>

<% end %>
" name="iface_status2G"> " name="iface_status5G"> <% if WLAN5G_2=="1" then --[[ #### WLAN5G_2 feature ### --]] %> " name="iface_status52G"> <% end %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 START ### --]] %> <% end %>
<% if WLAN24G=="1" and WLAN5G=="1" then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 START ### --]] %> <% end --[[ #### WLAN5G_2 END ### --]] %> <% end %>
<%:Wireless Settings%>
<%:Device Name%>
<%:Country / Region%>
<%:Band Steering%> <% if uci:get('functionlist','functionlist','SUPPORT_BANDSTEER_SELECT_LIST') == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 START ### --]] %> <%:dBm%> <% end --[[ #### WLAN5G_2 END ### --]] %>
5GHz RSSI  "/><%:dBm%>

<% bandsteerpersent = uci:get("wireless","wifi0","bandsteerpersent") %> <%:Percent of clients on 5GHz radio %>%
<% else %> <%:Enable%> <%:Disable%> <% end %> <% if uci:get('functionlist','functionlist','SUPPORT_BANDSTEER_FORCE_5G') == '1' then --[[ #### SUPPORT_BANDSTEER_FORCE_5G START ### --]] %> <% end --[[ #### SUPPORT_BANDSTEER_FORCE_5G END ### --]] %>
 <%:NOTE%>: <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 START ### --]] %> <%:In order for Band Steering function to work properly, 2.4GHz and 5GHz-1 and 5GHz-2 SSID and Security Settings must be the same.%> <% else --[[ #### WLAN5G_2 ELSE ### --]] %> <%:In order for Band Steering function to work properly, both 2.4GHz and 5GHz SSID and Security Settings must be the same.%> <% end --[[ #### WLAN5G_2 END ### --]] %>
<%:5GHz Load Balance%>  <%:NOTE%>: <%:The SSID on both the low-band and high-band should be set to the same name and encryption.%>
<% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% else %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% if uci:get('functionlist','functionlist','SUPPORT_WLAN_EXTENSION_CHANNEL') == '1' then --[[ #### SUPPORT_WLAN_EXTENSION_CHANNEL START ### --]] %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% end --[[ #### SUPPORT_WLAN_EXTENSION_CHANNEL END ### --]] %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% if uci:get('functionlist','functionlist', 'SUPPORT_MIN_RATE_SETTING') == '1' then%> <% if WLAN24G == '1' then %> <% end --[[ #### WLAN24G feature ### end --]]%> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end --[[ #### WLAN5G feature ### end --]]%> <% else %> <% if WLAN24G == '1' then %> <% end --[[ #### WLAN24G feature ### end --]]%> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end --[[ #### WLAN5G feature ### end --]]%> <% end --[[ #### else SUPPORT_MIN_RATE_SETTING ### end --]]%> <% if uci:get('functionlist','functionlist', 'SUPPORT_MIN_RATE_SETTING') ~= '1' then%> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% end --[[ #### SUPPORT_MIN_RATE_SETTING ### end --]] %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% if WLAN5G == '1' and WLAN24G ~= "1" and uci:get('functionlist','functionlist','HWMODE_AC') == '1' then%> <% else %> "1") or uci:get('functionlist','functionlist','SUPPORT_HIDE_AGGREGATION_SETTING') == '1' then %> style="display:none" <% end %> > <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if uci:get('functionlist','functionlist','HWMODE_AC') == '1' then %> <% else --[[ #### without HWMODE_AC support aggregation ### --]] %> <% end %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% end %> <% if uci:get('functionlist','functionlist','SUPPORT_MULTI_TO_UNI_CONVERSION') == '1' then %> <% if radioNum == 2 then %> <% end %> <% if radioNum == 3 then %> <% end %> <% end %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% if uci:get('functionlist','functionlist','SUPPORT_WLAN_OUTDOOR_DISTANCE_ENV') == '1' then --[[ #### SUPPORT_WLAN_OUTDOOR_DISTANCE_ENV START ### --]] if uci:get('sysProductInfo','model','outdoor') == '1' then %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% end end --[[ #### SUPPORT_WLAN_OUTDOOR_DISTANCE_ENV END ### --]] if uci:get('functionlist','functionlist','SUPPORT_WLAN_OUTDOOR_DISTANCE') == '1' then --[[ #### SUPPORT_WLAN_OUTDOOR_DISTANCE START ### --]] if uci:get('sysProductInfo','model','outdoor') == '1' then %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% end end-----#### SUPPORT_WLAN_OUTDOOR_DISTANCE END #### %>
2.4GHz5GHz -1 (Band3, 4) 5GHz -2 (Band1, 2)5GHz
<%:Operation Mode%>
<% if radioNum == 3 then %> <% end %>
<% if radioNum == 3 then %>
<% end %>
<% if radioNum == 3 then %> <% end %>
<% if radioNum == 3 then %>
<% end %>
<% if radioNum == 3 then %> <% end %>
<% if radioNum == 3 then %>
<% end %>
<%:Wireless Mode%>
<%:Channel HT Mode%>
<%:Extension Channel%>
<%:Channel%>
<%:Transmit Power%>
<%:Bit Rate%> <%:Data Rate%>
<%:RTS/CTS Threshold%> (1 - 2346)
<%:Client Limits%>
<%:Aggregation%>

<%:Frames%>
<%:Bytes(Max)%>



<%:Frames%>
<%:Bytes(Max)%>


<%:Multicast to Unicast Stream Conversion%>
  

<%:AP Detection%>
<% if uci:get('functionlist','functionlist','SUPPORT_DISTANCE_ALGORITHM1') == '1' then -----#### SUPPORT_WLAN_OUTDOOR_DISTANCE START ### %> <%:Noise Environment%> <% else %> <%:Noise Environment%> <% end %>
/>
/>
<% if uci:get('functionlist','functionlist','SUPPORT_DISTANCE_ALGORITHM1') == '1' then --[[ #### SUPPORT_WLAN_OUTDOOR_DISTANCE START ### --]] %> <%:Distance %> <% else %> <%:Distance %>(0-30<%:km%>) <% end %>
(
0
<%:miles%>)
(
0
<%:miles%>)
(
0
<%:miles%>)
<% if WLAN24G == '1' then %>
<% end %> <% if WLAN5G == '1' then %>
<% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %>
<% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% if uci:get('functionlist','functionlist','SUPPORT_GUEST_NETWORK_SETTING') == '1' then --[[ #### SUPPORT_GUEST_NETWORK_SETTING START ### --]] %> <% if uci:get('functionlist','functionlist','SUPPORT_GUEST_NETWORK_BY_SSID') ~= '1' then --[[ #### SUPPORT_GUEST_NETWORK_BY_SSID START ### --]] %>
<% end %>
<% if uci:get('functionlist','functionlist','SUPPORT_GUEST_NETWORK_BY_SSID') == '1' then --[[ #### SUPPORT_GUEST_NETWORK_BY_SSID START ### --]] %> <% end %>
<%:Guest Network DHCP Server Settings%>
<%:Manual IP Settings%>
<%:IP Address%> " name="cbid.network.guest.ipaddr" style="width: 200px;">
<%:Subnet Mask%> " name="cbid.network.guest.netmask" style="width: 200px;">
<%:Automatic DHCP Server Settings%>
<%:Starting IP Address%> " name="cbid.dhcp.guest.start" style="width: 200px;">
<%:Ending IP Address%> " name="cbid.dhcp.guest.limit" style="width: 200px;">
<%:WINS Server IP%> " name="cbid.dhcp.guest.dhcp_option" style="width: 200px;">
<% end --[[ #### SUPPORT_GUEST_NETWORK_SETTING END ### --]] %>
<% if uci:get('functionlist','functionlist', 'SUPPORT_DUAL_FAST_HANDOVER') == '1' then %> <% end %> <% if uci:get('functionlist','functionlist', 'SUPPORT_DUAL_FAST_HANDOVER') == '1' then %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% else %> <% end %> <% if uci:get('functionlist','functionlist', 'SUPPORT_DUAL_FAST_HANDOVER') == '1' then %> <% if WLAN24G == '1' then %> <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% else %> <% end %> <% if uci:get('functionlist','functionlist','SUPPORT_RSSI_THRESHOLD_MSG') == '1' then --[[ #### SUPPORT_RSSI_THRESHOLD_MSG START ### --]] %> <% end -----#### SUPPORT_RSSI_THRESHOLD_MSG END ### %>
<%:RSSI Threshold%> <% if WLAN24G == '1' then %> 2.4GHz <% end %> <% if WLAN5G == '1' then %> <% if WLAN5G_2 == '1' then --[[ #### WLAN5G_2 feature ### --]] %> 5GHz -1 5GHz -2 <% else %> 5GHz <% end --[[ #### WLAN5G_2 feature ### end --]] %> <% end %> <% else %> <%:RSSI Threshold%>
<%:Status%> <%:Enable%> <%:Disable%> <%:Enable%> <%:Disable%> <%:Enable%> <%:Disable%> <%:Status%> <%:Enable%> <%:Disable%>
RSSI (<%:Range%>: <%=RSSI_THRESHOLD_MIN%>dBm ~ <%=RSSI_THRESHOLD_MAX%>dBm) " name="cbid.wireless.wifi0.fasthandover_rssi" style="width: 60px; " maxlength='4'> dBm " name="cbid.wireless.wifi1.fasthandover_rssi" style="width: 60px; " maxlength='4'> dBm " name="cbid.wireless.wifi2.fasthandover_rssi" style="width: 60px; " maxlength='4'> dBm RSSI " name="cbid.wireless.wifi0.fasthandover_rssi" style="width: 60px; " maxlength='4'/> dBm (<%:Range%>: <%=RSSI_THRESHOLD_MIN%>dBm ~ <%=RSSI_THRESHOLD_MAX%>dBm)
 <%:Caution%>: <%:Enabling RSSI Threshold disassociates wireless clients that fall below the configured RSSI threshold and may cause wireless clients to reconnect frequently. It is recommended to disable this feature unless you deem it absolutely necessary.%>
<%:Management VLAN Settings%>
<%:Status%> <%:Enable%> <%:Disable%> " name="cbid.network.sys.ManagementVLANID" style="width: 60px; " maxlength='4' >
 <%:Caution%>: <%:If you encounter disconnection issue during the configuration process, verify that the switch and the DHCP server can support the new VLAN ID and then connect to the new IP address.%>
<% for _, dev in ipairs(devices) do local nets = wifi_all_net[dev:name()]["all"] --local opmode = string.sub(luci.sys.exec("uci get wireless.%s.opmode" %dev:name()),1,-2) %> <% -- network list -- if #nets > 0 then for i, net in ipairs(nets) do --luci.cbi.load("admin_network/wifi_iface1",net:id())[1]:render() local networkName = net:name() if filterRadio and string.find(networkName, filterRadio) then --[[ #### filter Radio ### --]] else if not string.find(networkName, "mesh") then %> <% end %> <% end --[[ #### filter Radio end ### --]] end end -- /network list -- end %>

<%if luci.model.uci.cursor():get('functionlist','functionlist','HAS_ALL_APPLY') == '1' then%>  <%:Apply saved settings to take effect %> <%else%>  <%:Save Current Setting(s)%> <%end%>
<%+footer%>