%+header%> <% local disp = require "luci.dispatcher" local path = disp.context.path local request = disp.context.request local mtkwifi = require("mtkwifi") local devs = mtkwifi.get_all_devs() local devname local vifname, vifidx local dev = {} local vif = {} if request[4] == "vif_add_view" then devname, vifname = request[5], request[6] dev = devs and devs[devname] vifname = vifname..#dev.vifs vifidx = #dev.vifs + 1 elseif request[4] == "vif_cfg_view" then devname, vifname = request[5], request[6] dev = devs and devs[devname] or nil vif = dev and dev.vifs[vifname] or nil vifidx = vif and vif.vifidx or nil end local cfgs = mtkwifi.load_profile(dev.profile) local diff = mtkwifi.diff_profile(dev.profile) local WscValue = mtkwifi.token_get(cfgs["WscConfMode"], vifidx, "0") or "0" local appliedWscValue = diff["WscConfMode"] and mtkwifi.token_get(diff["WscConfMode"][2], vifidx) or nil local map_cfgs local first_card_cfgs = mtkwifi.load_profile(mtkwifi.detect_first_card()) local appliedMapModeDiff if pcall(require, "map_helper") then map_cfgs = mtkwifi.load_profile(mtkwifi.__read_easymesh_profile_path()) local appliedMapDiffTable = mtkwifi.diff_profile(mtkwifi.detect_first_card()) appliedMapModeDiff = appliedMapDiffTable["MapMode"] and appliedMapDiffTable["MapEnable"][2] or nil end local AuthModes = {} local EncryptionTypeLists = {} if string.split(cfgs.WirelessMode,";")[1] == "18" then AuthModes = (WscValue == "0") and dev.AuthModeList_6G or dev.WpsEnableAuthModeList_6G EncryptionTypeLists = dev.EncryptionTypeList_6G else AuthModes = (WscValue == "0") and dev.AuthModeList or dev.WpsEnableAuthModeList EncryptionTypeLists = dev.EncryptionTypeList end %>
<%+footer%>