garypang13 5 жил өмнө
parent
commit
07d7a4f06f

+ 373 - 0
XY-C5/.config

@@ -0,0 +1,373 @@
+CONFIG_TARGET_ramips=y
+CONFIG_TARGET_ramips_mt7621=y
+CONFIG_TARGET_ramips_mt7621_DEVICE_d-team_newifi-d2=y
+CONFIG_PACKAGE_kmod-mt7615-firmware=n
+CONFIG_PACKAGE_kmod-mt7615e=n
+CONFIG_GRUB_TIMEOUT="0"
+CONFIG_SIGNATURE_CHECK=n
+CONFIG_TARGET_ROOTFS_EXT4FS=n
+CONFIG_LUCI_CSSTIDY=n
+CONFIG_GRUB_CONSOLE=n
+
+CONFIG_KERNEL_MIPS_FPU_EMULATOR=y
+
+# IPv6支持:
+CONFIG_IPV6=y
+
+# USB3.0支持:
+CONFIG_PACKAGE_kmod-usb2=y
+CONFIG_PACKAGE_kmod-usb2-pci=y
+CONFIG_PACKAGE_kmod-usb3=y
+CONFIG_PACKAGE_kmod-usb-audio=y
+CONFIG_PACKAGE_kmod-usb-printer=y
+
+# Applications
+CONFIG_PACKAGE_luci-app-accesscontrol=n
+CONFIG_PACKAGE_luci-app-acme=n
+CONFIG_PACKAGE_luci-app-adblock=n
+CONFIG_PACKAGE_luci-app-adbyby-plus=n
+CONFIG_PACKAGE_luci-app-adguardhome=n
+CONFIG_PACKAGE_luci-app-advanced=y
+CONFIG_PACKAGE_luci-app-advanced-reboot=n
+CONFIG_PACKAGE_luci-app-advancedsetting=n
+CONFIG_PACKAGE_luci-app-ahcp=n
+CONFIG_PACKAGE_luci-app-airplay2=n
+CONFIG_PACKAGE_luci-app-airwhu=n
+CONFIG_PACKAGE_luci-app-aliddns=n
+CONFIG_PACKAGE_luci-app-amule=n
+CONFIG_PACKAGE_luci-app-appfilter=n
+CONFIG_PACKAGE_luci-app-aria2=n
+CONFIG_PACKAGE_luci-app-arpbind=n
+CONFIG_PACKAGE_luci-app-autoipsetadder=n
+CONFIG_PACKAGE_luci-app-autoreboot=n
+CONFIG_PACKAGE_luci-app-baidupcs-web=n
+CONFIG_PACKAGE_luci-app-banip=n
+CONFIG_PACKAGE_luci-app-bcp38=n
+CONFIG_PACKAGE_luci-app-beardropper=n
+CONFIG_PACKAGE_luci-app-bird1-ipv4=n
+CONFIG_PACKAGE_luci-app-bird1-ipv6=n
+CONFIG_PACKAGE_luci-app-bmx6=n
+CONFIG_PACKAGE_luci-app-bmx7=n
+CONFIG_PACKAGE_luci-app-brook=n
+CONFIG_PACKAGE_luci-app-cd8021x=n
+CONFIG_PACKAGE_luci-app-chinadns=n
+CONFIG_PACKAGE_luci-app-cifs=n
+CONFIG_PACKAGE_luci-app-cjdns=n
+CONFIG_PACKAGE_luci-app-clamav=n
+CONFIG_PACKAGE_luci-app-clash=n
+CONFIG_PACKAGE_luci-app-commands=n
+CONFIG_PACKAGE_luci-app-control-timewol=n
+CONFIG_PACKAGE_luci-app-cpulimit=n
+CONFIG_PACKAGE_luci-app-cshark=n
+CONFIG_PACKAGE_luci-app-dcwapd=n
+CONFIG_PACKAGE_luci-app-ddns=n
+CONFIG_PACKAGE_luci-app-diag-core=n
+CONFIG_PACKAGE_luci-app-diskman=n
+CONFIG_PACKAGE_luci-app-diskman_INCLUDE_btrfs_progs=y
+CONFIG_PACKAGE_luci-app-diskman_INCLUDE_lsblk=y
+CONFIG_PACKAGE_luci-app-diskman_INCLUDE_mdadm=n
+CONFIG_PACKAGE_luci-app-dnscrypt-proxy=n
+CONFIG_PACKAGE_luci-app-dnscrypt-proxy2=n
+CONFIG_PACKAGE_luci-app-dnscrypt-proxy2_INCLUDE_minisign=n
+CONFIG_PACKAGE_luci-app-dnsforwarder=n
+CONFIG_PACKAGE_luci-app-docker=n
+CONFIG_PACKAGE_luci-app-dockerman=n
+CONFIG_PACKAGE_luci-app-dump1090=n
+CONFIG_PACKAGE_luci-app-dynapoint=n
+CONFIG_PACKAGE_luci-app-e2guardian=n
+CONFIG_PACKAGE_luci-app-eqos=n
+CONFIG_PACKAGE_luci-app-familycloud=n
+CONFIG_PACKAGE_luci-app-fileassistant=n
+CONFIG_PACKAGE_luci-app-filebrowser=n
+CONFIG_PACKAGE_luci-app-filerun=n
+CONFIG_PACKAGE_luci-app-filetransfer=n
+CONFIG_PACKAGE_luci-app-firewall=y
+CONFIG_PACKAGE_luci-app-freifunk-diagnostics=n
+CONFIG_PACKAGE_luci-app-freifunk-policyrouting=n
+CONFIG_PACKAGE_luci-app-freifunk-widgets=n
+CONFIG_PACKAGE_luci-app-frpc=n
+CONFIG_PACKAGE_luci-app-frps=n
+CONFIG_PACKAGE_luci-app-fwknopd=n
+CONFIG_PACKAGE_luci-app-gpsysupgrade=y
+CONFIG_PACKAGE_luci-app-gost=n
+CONFIG_PACKAGE_luci-app-gowebdav=n
+CONFIG_PACKAGE_luci-app-guest-wifi=n
+CONFIG_PACKAGE_luci-app-haproxy-tcp=n
+CONFIG_PACKAGE_luci-app-hd-idle=n
+CONFIG_PACKAGE_luci-app-hnet=n
+CONFIG_PACKAGE_luci-app-https-dns-proxy=n
+CONFIG_PACKAGE_luci-app-ipsec-vpnd=n
+CONFIG_PACKAGE_luci-app-ipsec-vpnserver-manyusers=n
+CONFIG_PACKAGE_luci-app-iptvhelper=n
+CONFIG_PACKAGE_luci-app-jd-dailybonus=n
+CONFIG_PACKAGE_luci-app-k3screenctrl=n
+CONFIG_PACKAGE_luci-app-kcptun=n
+CONFIG_PACKAGE_luci-app-kodexplorer=n
+CONFIG_PACKAGE_luci-app-koolproxyR=n
+CONFIG_PACKAGE_luci-app-ksmbd=n
+CONFIG_PACKAGE_luci-app-lxc=n
+CONFIG_PACKAGE_luci-app-luci-app-oled=y
+CONFIG_PACKAGE_luci-app-mentohust=n
+CONFIG_PACKAGE_luci-app-meshwizard=n
+CONFIG_PACKAGE_luci-app-minidlna=n
+CONFIG_PACKAGE_luci-app-mjpg-streamer=n
+CONFIG_PACKAGE_luci-app-music-remote-center=n
+CONFIG_PACKAGE_luci-app-mwan3=n
+CONFIG_PACKAGE_luci-app-mwan3helper=n
+CONFIG_PACKAGE_luci-app-mwol=n
+CONFIG_PACKAGE_luci-app-n2n_v2=n
+CONFIG_PACKAGE_luci-app-naiveproxy=n
+CONFIG_PACKAGE_luci-app-netdata=n
+CONFIG_PACKAGE_luci-app-nextdns=n
+CONFIG_PACKAGE_luci-app-nfs=n
+CONFIG_PACKAGE_luci-app-nft-qos=n
+CONFIG_PACKAGE_luci-app-nginx-pingos=n
+CONFIG_PACKAGE_luci-app-ngrokc=n
+CONFIG_PACKAGE_luci-app-njitclient=n
+CONFIG_PACKAGE_luci-app-nlbwmon=n
+CONFIG_PACKAGE_luci-app-noddos=n
+CONFIG_PACKAGE_luci-app-nps=n
+CONFIG_PACKAGE_luci-app-ntpc=n
+CONFIG_PACKAGE_luci-app-nut=n
+CONFIG_PACKAGE_luci-app-oaf=n
+CONFIG_PACKAGE_luci-app-ocserv=n
+CONFIG_PACKAGE_luci-app-oled=n
+CONFIG_PACKAGE_luci-app-olsr=n
+CONFIG_PACKAGE_luci-app-olsr-services=n
+CONFIG_PACKAGE_luci-app-olsr-viz=n
+CONFIG_PACKAGE_luci-app-onliner=n
+CONFIG_PACKAGE_luci-app-openclash=n
+CONFIG_PACKAGE_luci-app-openvpn=n
+CONFIG_PACKAGE_luci-app-openvpn-server=n
+CONFIG_PACKAGE_luci-app-opkg=y
+CONFIG_PACKAGE_luci-app-oscam=n
+CONFIG_PACKAGE_luci-app-p910nd=n
+CONFIG_PACKAGE_luci-app-pagekitec=n
+CONFIG_PACKAGE_luci-app-passwall=n
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks=y
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR=y
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Server=n
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Server=n
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray=y
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_Plus=y
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_GO=n
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Brook=n
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_kcptun=n
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_haproxy=n
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_v2ray-plugin=n
+CONFIG_PACKAGE_luci-app-passwall_INCLUDE_simple-obfs=n
+CONFIG_PACKAGE_luci-app-polipo=n
+CONFIG_PACKAGE_luci-app-pppoe-relay=n
+CONFIG_PACKAGE_luci-app-pppoe-server=n
+CONFIG_PACKAGE_luci-app-pptp-vpnserver-manyusers=n
+CONFIG_PACKAGE_luci-app-privoxy=n
+CONFIG_PACKAGE_luci-app-ps3netsrv=n
+CONFIG_PACKAGE_luci-app-qbittorrent=n
+CONFIG_PACKAGE_luci-app-qos=n
+CONFIG_PACKAGE_luci-app-qosv4=n
+CONFIG_PACKAGE_luci-app-radicale=n
+CONFIG_PACKAGE_luci-app-radicale2=n
+CONFIG_PACKAGE_luci-app-ramfree=n
+CONFIG_PACKAGE_luci-app-rclone=n
+CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-webui=n
+CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-ng=n
+CONFIG_PACKAGE_luci-app-rclone_INCLUDE_fuse-utils=y
+CONFIG_PACKAGE_luci-app-rosy-file-server=n
+CONFIG_PACKAGE_luci-app-rp-pppoe-server=n
+CONFIG_PACKAGE_luci-app-samba=n
+CONFIG_PACKAGE_luci-app-samba4=n
+CONFIG_PACKAGE_luci-app-scutclient=n
+CONFIG_PACKAGE_luci-app-serverchan=n
+CONFIG_PACKAGE_luci-app-shadowsocks-libev=n
+CONFIG_PACKAGE_luci-app-shairplay=n
+CONFIG_PACKAGE_luci-app-siitwizard=n
+CONFIG_PACKAGE_luci-app-simple-adblock=n
+CONFIG_PACKAGE_luci-app-smartdns=n
+CONFIG_PACKAGE_luci-app-smstool=n
+CONFIG_PACKAGE_luci-app-snmpd=n
+CONFIG_PACKAGE_luci-app-softethervpn=n
+CONFIG_PACKAGE_luci-app-softethervpn5=n
+CONFIG_PACKAGE_luci-app-speederv2=n
+CONFIG_PACKAGE_luci-app-splash=n
+CONFIG_PACKAGE_luci-app-sqm=n
+CONFIG_PACKAGE_luci-app-squid=n
+CONFIG_PACKAGE_luci-app-ssocks=n
+CONFIG_PACKAGE_luci-app-ssr-mudb-server=n
+CONFIG_PACKAGE_luci-app-ssr-plus=y
+CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_V2ray_plugin=n
+CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_V2ray=y
+CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Trojan=y
+CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_NaiveProxy=n
+CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Kcptun=n
+CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Server=n
+CONFIG_PACKAGE_luci-app-ssrserver-python=n
+CONFIG_PACKAGE_luci-app-statistics=n
+CONFIG_PACKAGE_luci-app-syncdial=n
+CONFIG_PACKAGE_luci-app-syncthing=n
+CONFIG_PACKAGE_luci-app-sysuh3c=n
+CONFIG_PACKAGE_luci-app-tcpdump=n
+CONFIG_PACKAGE_luci-app-terminal=n
+CONFIG_PACKAGE_luci-app-timecontrol=n
+CONFIG_PACKAGE_luci-app-tinyproxy=n
+CONFIG_PACKAGE_luci-app-transmission=n
+CONFIG_PACKAGE_luci-app-travelmate=n
+CONFIG_PACKAGE_luci-app-ttyd=n
+CONFIG_PACKAGE_luci-app-turboacc=y
+CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_flow-offload=y
+CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_shortcut-fe=n
+CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_dnsforwarder=y
+CONFIG_PACKAGE_luci-app-udp2raw=n
+CONFIG_PACKAGE_luci-app-udpxy=n
+CONFIG_PACKAGE_luci-app-uhttpd=n
+CONFIG_PACKAGE_luci-app-unblockmusic=n
+CONFIG_UnblockNeteaseMusic_Go=n
+CONFIG_UnblockNeteaseMusic_NodeJS=n
+CONFIG_PACKAGE_luci-app-unblockneteasemusic=n
+CONFIG_PACKAGE_luci-app-unblockneteasemusic-go=n
+CONFIG_PACKAGE_luci-app-unblockneteasemusic-mini=n
+CONFIG_PACKAGE_luci-app-unbound=n
+CONFIG_PACKAGE_luci-app-upnp=y
+CONFIG_PACKAGE_luci-app-usb-printer=n
+CONFIG_PACKAGE_luci-app-usb3disable=n
+CONFIG_PACKAGE_luci-app-v2ray-server=n
+CONFIG_PACKAGE_luci-app-verysync=n
+CONFIG_PACKAGE_luci-app-vlmcsd=n
+CONFIG_PACKAGE_luci-app-vnstat=n
+CONFIG_PACKAGE_luci-app-vpn-policy-routing=n
+CONFIG_PACKAGE_luci-app-vpnbypass=n
+CONFIG_PACKAGE_luci-app-vsftpd=n
+CONFIG_PACKAGE_luci-app-vssr=n
+CONFIG_PACKAGE_luci-app-vssr_INCLUDE_V2ray_plugin=n
+CONFIG_PACKAGE_luci-app-vssr_INCLUDE_V2ray=n
+CONFIG_PACKAGE_luci-app-vssr_INCLUDE_Trojan=n
+CONFIG_PACKAGE_luci-app-vssr_INCLUDE_Kcptun=n
+CONFIG_PACKAGE_luci-app-vssr_INCLUDE_ShadowsocksR_Server=n
+CONFIG_PACKAGE_luci-app-watchcat=n
+CONFIG_PACKAGE_luci-app-webadmin=n
+CONFIG_PACKAGE_luci-app-wifischedule=n
+CONFIG_PACKAGE_luci-app-wireguard=n
+CONFIG_PACKAGE_luci-app-wol=n
+CONFIG_PACKAGE_luci-app-wrtbwmon=n
+CONFIG_PACKAGE_luci-app-xlnetacc=n
+CONFIG_PACKAGE_luci-app-zerotier=n
+
+# Themes
+CONFIG_PACKAGE_luci-theme-argon=n
+CONFIG_PACKAGE_luci-theme-argon-dark-mod=n
+CONFIG_PACKAGE_luci-theme-argon-light-mod=n
+CONFIG_PACKAGE_luci-theme-bootstrap=y
+CONFIG_PACKAGE_luci-theme-bootstrap-mod=n
+CONFIG_PACKAGE_luci-theme-edge=y
+CONFIG_PACKAGE_luci-theme-freifunk-generic=n
+CONFIG_PACKAGE_luci-theme-material=n
+CONFIG_PACKAGE_luci-theme-opentomato=n
+CONFIG_PACKAGE_luci-theme-openwrt=n
+
+
+# 其他需要安装的软件包:
+
+CONFIG_PACKAGE_dnsmasq=n
+CONFIG_PACKAGE_dnsmasq-full=y
+CONFIG_PACKAGE_dnsmasq_full_dhcp=y
+CONFIG_PACKAGE_dnsmasq_full_ipset=y
+
+CONFIG_PACKAGE_luci-ssl-nginx=n
+CONFIG_NGINX_DAV=y
+CONFIG_NGINX_NAXSI=n
+CONFIG_NGINX_STREAM_CORE_MODULE=y
+CONFIG_NGINX_STREAM_SSL_PREREAD_MODULE=y
+CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
+CONFIG_PACKAGE_luci-base=y
+CONFIG_PACKAGE_luci-compat=y
+CONFIG_PACKAGE_luci-lib-ipkg=y
+CONFIG_PACKAGE_luci-proto-ppp=y
+CONFIG_LUCI_LANG_zh_Hans=y
+CONFIG_LUCI_LANG_en=y
+CONFIG_PACKAGE_coremark=y
+CONFIG_PACKAGE_zoneinfo-asia=y
+CONFIG_PACKAGE_default-settings=y
+CONFIG_PACKAGE_iptables-mod-filter=y
+CONFIG_PACKAGE_bind-dig=n
+CONFIG_PACKAGE_wget=y
+CONFIG_PACKAGE_curl=y
+CONFIG_PACKAGE_htop=y
+CONFIG_PACKAGE_httping=y
+CONFIG_PACKAGE_tcping=n
+CONFIG_PACKAGE_autocore=y
+CONFIG_PACKAGE_automount=y
+CONFIG_PACKAGE_autosamba=y
+CONFIG_PACKAGE_autosamba-ksmbd=y
+CONFIG_PACKAGE_fdisk=n
+CONFIG_PACKAGE_cfdisk=n
+CONFIG_PACKAGE_nano=y
+CONFIG_PACKAGE_iptables-mod-fullconenat=y
+# CONFIG_PACKAGE_git=y
+# CONFIG_PACKAGE_git-http=y
+CONFIG_PACKAGE_open-vm-tools=n
+CONFIG_V2RAY_COMPRESS_UPX=n
+CONFIG_DEVEL=y
+CONFIG_CCACHE=y
+# CONFIG_TOOLCHAINOPTS=y
+# CONFIG_GCC_USE_VERSION_9=n
+CONFIG_PACKAGE_lm-sensors-detect=y
+CONFIG_PACKAGE_bc=n
+CONFIG_PACKAGE_ethtool=n
+CONFIG_PACKAGE_file=n
+CONFIG_PACKAGE_kmod-fs-exfat0=y #Will only be built for kernel 4.19
+
+CONFIG_BUSYBOX_CUSTOM=y
+CONFIG_BUSYBOX_CONFIG_FEATURE_XARGS_SUPPORT_REPL_STR=y
+
+CONFIG_PACKAGE_unzip=y
+CONFIG_PACKAGE_bash=y
+CONFIG_PACKAGE_ca-bundle=y
+CONFIG_OPENSSL_OPTIMIZE_SPEED=y
+
+CONFIG_PACKAGE_kmod-macvlan=y
+CONFIG_PACKAGE_kmod-tun=y
+CONFIG_PACKAGE_kmod-ipt-tproxy=y
+CONFIG_PACKAGE_kmod-ipt-nat-extra=y
+CONFIG_PACKAGE_kmod-ipt-nat6=y
+CONFIG_PACKAGE_kmod-nf-nathelper=y
+CONFIG_PACKAGE_kmod-nf-nathelper-extra=y
+CONFIG_PACKAGE_kmod-sched=y
+
+# x86
+CONFIG_PACKAGE_kmod-sound-core=y
+CONFIG_PACKAGE_kmod-sound-hda-codec-realtek=y
+CONFIG_PACKAGE_kmod-sound-hda-intel=y
+CONFIG_PACKAGE_kmod-sound-hda-codec-hdmi=y
+
+# ipsec-vpnd
+CONFIG_PACKAGE_kmod-crypto-authenc=y
+CONFIG_PACKAGE_kmod-ipsec=y
+CONFIG_PACKAGE_kmod-ipsec4=y
+CONFIG_PACKAGE_kmod-ipsec6=y
+CONFIG_PACKAGE_kmod-ipt-ipsec=y
+
+# ksmbd
+CONFIG_PACKAGE_kmod-fs-ksmbd=y
+
+#AppFilter
+CONFIG_PACKAGE_kmod-oaf=y
+
+# nfs
+CONFIG_PACKAGE_kmod-fs-nfsd=y
+CONFIG_PACKAGE_kmod-fs-nfs=y
+CONFIG_PACKAGE_kmod-fs-nfs-v4=y
+
+# cifsmount
+CONFIG_PACKAGE_kmod-fs-cifs=y
+CONFIG_PACKAGE_kmod-nls-utf8=y
+CONFIG_PACKAGE_kmod-crypto-misc=y
+
+# eqos
+CONFIG_PACKAGE_kmod-ifb=y
+
+# syncdial
+CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y
+CONFIG_PACKAGE_kmod-ipt-ipopt=y
+CONFIG_PACKAGE_kmod-ipt-raw=y
+
+CONFIG_GRUB_BOOTOPTS="nomodeset"
+CONFIG_KERNEL_BUILD_USER="GaryPang"

+ 16 - 0
XY-C5/default-settings

@@ -0,0 +1,16 @@
+if [ ! -f /etc/config/placeholder ]; then
+	uci set smartdns.@smartdns[0].port='5335'
+	uci set smartdns.@smartdns[0].redirect='dnsmasq-upstream'
+	uci set smartdns.@smartdns[0].anti_ad='1'
+	uci commit smartdns
+fi
+
+touch /etc/config/placeholder
+
+sed -i '$a src/gz openwrt_custom https://op.supes.top/packages/mipsel' /etc/opkg/customfeeds.conf
+
+uci set uhttpd.main.rfc1918_filter=0
+uci set uhttpd.main.redirect_https=0
+uci commit uhttpd
+
+exit 0

+ 2 - 0
XY-C5/diy.sh

@@ -0,0 +1,2 @@
+
+

+ 850 - 0
XY-C5/files/usr/lib/lua/luci/view/admin_mtk/mtk_wifi_dev_cfg.htm

@@ -0,0 +1,850 @@
+
+<%+header%>
+<!--
+    This module is a demo to configure MTK' proprietary WiFi driver.
+    Basic idea is to bypass uci and edit wireless profile (mt76xx.dat) directly.
+    LuCI's WiFi configuration is more logical and elegent, but it's quite tricky to 
+    translate uci into MTK's WiFi profile (like we did in "uci2dat").
+    Hua Shao <[email protected]>
+-->
+
+<%
+local disp = require "luci.dispatcher"
+-- local request  = disp.context.path
+local request = disp.context.request
+local mtkwifi = require("mtkwifi")
+local devname = request[5]
+local devs = mtkwifi.get_all_devs()
+local dev = {}
+for _,v in ipairs(devs) do
+    if v.devname == devname then
+        dev = v
+    end
+end
+
+local cfgs = mtkwifi.load_profile(dev.profile)
+
+%>
+
+
+<script type="text/javascript" src="<%=resource%>/cbi.js?v=git-17.250.41546-90ac861"></script>
+
+<div id="loading" style="margin-top: 1em; display: none;">
+<img src="<%=resource%>/icons/loading.gif" alt="<%:Loading%>" style="vertical-align:e;" />
+    &nbsp;&nbsp;&nbsp; Please waiting while the page is loading......
+</div>
+
+<form method="post" name="cbi" action="<%=luci.dispatcher.build_url("admin", "network", "wifi", "dev_cfg", devname)%>" enctype="multipart/form-data" onreset="return cbi_validate_reset(this)" onsubmit="return cbi_validate_form(this, 'Some fields are invalid, cannot save values!')" autocomplete="false">
+    <fieldset class="cbi-section">
+        <legend> 无线高级设置 - <%=devname%> 
+<%
+local diff = mtkwifi.diff_profile(dev.profile)
+if next(diff) ~= nil then
+%>
+    <span style="color:red;">(<a href="javascript:location.href='<%=luci.dispatcher.build_url("admin", "network", "wifi", "reload", dev.devname)%>'">reload</a> to apply changes)</span>
+<% 
+    end
+%>
+        </legend>
+        <table id="dev-cfg-basic" class="cbi-section-table">
+            <tr><th></th><td></td><td></td></tr>
+            <tr>
+                <td>模式</td>
+                <td>
+                    <select style="width:auto" name="WirelessMode" id="WirelessMode" onchange="WirelessMode_onchange(this.options[this.options.selectedIndex].value)">
+                        <% for k,v in pairs(dev.WirelessModeList) do %>
+                            <option value="<%=k%>" <% if tonumber(dev.WirelessMode) == tonumber(k) then%> selected="selected"<% end %>><%=k%> - <%=v%></option>
+                        <% end %>
+                    </select>
+                </td>
+                <td></td>
+            </tr>
+            <tr>
+                <td>信道</td>
+                <td>
+                    <select style="width:auto; min-width:180px;" name="Channel" id="Channel" onchange="Channel_onchange(this.value)" <% if cfgs.ApCliEnable == "1" then %> disabled="disabled" <% end %>>
+                    </select>
+                </td>
+                <td><% if cfgs.ApCliEnable == "1" then %> APClient/Repeater Mode. <% end %></td>
+            </tr>
+            <tr>
+                <td>区域代码</td>
+                <td>
+                    <select name="CountryCode" style="width:auto">
+                        <option value="US" id="advCountryCodeUS" <% if cfgs.CountryCode == "US" then %> selected="selected"<% end %>>US (United States)</option>
+                        <option value="JP" id="advCountryCodeJP" <% if cfgs.CountryCode == "JP" then %> selected="selected"<% end %>>JP (Japan)</option>
+                        <option value="FR" id="advCountryCodeFR" <% if cfgs.CountryCode == "FR" then %> selected="selected"<% end %>>FR (France)</option>
+                        <option value="TW" id="advCountryCodeTW" <% if cfgs.CountryCode == "TW" then %> selected="selected"<% end %>>TW (Taiwan)</option>
+                        <option value="IE" id="advCountryCodeIE" <% if cfgs.CountryCode == "IE" then %> selected="selected"<% end %>>IE (Ireland)</option>
+                        <option value="HK" id="advCountryCodeHK" <% if cfgs.CountryCode == "HK" then %> selected="selected"<% end %>>HK (Hong Kong)</option>
+                        <option value="NONE" id="advCountryCodeNONE"<% if cfgs.CountryCode == "NONE" then %> checked="checked"<% end %>>NONE</option>
+                    </select>
+                </td>
+                <td></td>
+            </tr>
+            <tr>
+                <td>Country Region</td>
+                <td>
+                    <select style="width:auto; min-width:180px;" name="__cr" id="__cr" onchange="CountryRegion_onchange(this.value)">
+                    </select>
+                </td>
+                <td></td>
+            </tr>
+            <% if cfgs.HT_OpMode then %>
+            <tr>
+                <td>无线模式</td>
+                <td>
+                    <select style="width:auto" name="HT_OpMode">
+                        <option value="0" <% if cfgs.HT_OpMode == "0" then %> selected="selected"<% end%>>正常模式</option>
+                        <option value="1" <% if cfgs.HT_OpMode == "1" then %> selected="selected"<% end%>>绿色模式</option>
+                    </select>
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.HT_GI then %>
+            <tr>
+                <td>HT Guard Interval</td>
+                <td>
+                    <select style="width:auto" name="HT_GI">
+                        <option value="0" <% if cfgs.HT_GI == "0" then %> selected="selected"<% end%>>Long</option>
+                        <option value="1" <% if cfgs.HT_GI == "1" then %> selected="selected"<% end%>>Short</option>
+                        <option value="2" <% if cfgs.HT_GI == "2" then %> selected="selected"<% end%>>Auto</option>
+                    </select>
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <tr>
+                <td>信道带宽</td>
+                <td>
+                    <select style="width:auto" name="__bw" id="__bw" onchange="Bw_onchange(this.options[this.options.selectedIndex].value)">
+                        <option value="20" <% if dev.__bw == "20" then %> selected="selected"<% end%>>20 MHz</option>
+                        <option value="40" <% if dev.__bw == "40" then %> selected="selected"<% end%>>40 MHz</option>
+                        <option value="60" <% if dev.__bw == "60" then %> selected="selected"<% end%>>20/40 MHz</option>
+                        <option value="80" <% if dev.__bw == "80" then %> selected="selected"<% end%>>80 MHz</option>
+                        <option value="160" <% if dev.__bw == "160" then %> selected="selected"<% end%>>160 MHz</option>
+                        <option value="161" <% if dev.__bw == "161" then %> selected="selected"<% end%>>80+80 MHz</option>
+                    </select>
+                </td>
+                <td></td>
+            </tr>
+            <% if cfgs.VHT_BW then %>
+            <tr>
+                <td>2G 40MHZ模式辅助信道</td>
+                <td>
+                    <select style="width:auto; min-width:180px;" name="HT_EXTCHA" id="HT_EXTCHA" <% if cfgs.ApCliEnable == "1" or dev.__bw ~= "40" or dev.__bw ~= "60" then %> disabled="disabled" <% end %>>
+                    </select>
+                </td>
+                <td><% if cfgs.ApCliEnable == "1" then %> APClient/Repeater Mode. <% end %></td>
+            </tr>
+            <tr>
+                <td>5G 2nd 80Mhz Channel</td>
+                <td>
+                    <select style="width:auto; min-width:180px;" name="VHT_Sec80_Channel" id="VHT_Sec80_Channel" <% if cfgs.ApCliEnable == "1" or dev.__bw ~= "180" then %> disabled="disabled" <% end %>>
+                    </select>
+                </td>
+                <td><% if cfgs.ApCliEnable == "1" then %> APClient/Repeater Mode. <% end %></td>
+            </tr>
+            <% end %>
+            <% if cfgs.HT_STBC then %>
+            <tr>
+                <td>STBC</td>
+                <td>
+                    <input type="radio" name="HT_STBC" value="1" <% if cfgs.HT_STBC == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="HT_STBC" value="0" <% if cfgs.HT_STBC == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.HT_AMSDU then %>
+            <tr>
+                <td>A-MSDU</td>
+                <td>
+                    <input type="radio" name="HT_AMSDU" value="1" <% if cfgs.HT_AMSDU == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="HT_AMSDU" value="0" <% if cfgs.HT_AMSDU == "0" then %> checked="checked"<% end %>/> 禁用
+               </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.HT_AutoBA then %>
+            <tr>
+                <td>Auto Block ACK</td>
+                <td>
+                    <input type="radio" name="HT_AutoBA" value="1" <% if cfgs.HT_AutoBA == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="HT_AutoBA" value="0" <% if cfgs.HT_AutoBA == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.HT_BADecline then %>
+            <tr>
+                <td>Decline BA Request</td>
+                <td>
+                    <input type="radio" name="HT_BADecline" value="1" <% if cfgs.HT_BADecline == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="HT_BADecline" value="0" <% if cfgs.HT_BADecline == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.HT_DisallowTKIP then %>
+            <tr>
+                <td>HT Disallow TKIP</td>
+                <td>
+                    <input type="radio" name="HT_DisallowTKIP" value="1" <% if cfgs.HT_DisallowTKIP == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="HT_DisallowTKIP" value="0" <% if cfgs.HT_DisallowTKIP == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.HT_LDPC then %>
+            <tr>
+                <td>HT LDPC</td>
+                <td>
+                    <input type="radio" name="HT_LDPC" value="1" <% if cfgs.HT_LDPC == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="HT_LDPC" value="0" <% if cfgs.HT_LDPC == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.VHT_SGI then %>
+            <tr>
+                <td>VHT Short GI</td>
+                <td>
+                    <select style="width:auto" name="VHT_SGI">
+                        <option value="0" <% if cfgs.VHT_SGI == "0" then %> selected="selected"<% end%>>Long</option>
+                        <option value="1" <% if cfgs.VHT_SGI == "1" then %> selected="selected"<% end%>>Short</option>
+                    </select>
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.VHT_STBC then %>
+            <tr>
+                <td>VHT STBC</td>
+                <td>
+                    <input type="radio" name="VHT_STBC" value="1" <% if cfgs.VHT_STBC == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="VHT_STBC" value="0" <% if cfgs.VHT_STBC == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.VHT_BW_SIGNAL then %>
+            <tr>
+                <td>VHT BW Signaling</td>
+                <td>
+                    <input type="radio" name="VHT_BW_SIGNAL" value="1" <% if cfgs.VHT_BW_SIGNAL == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="VHT_BW_SIGNAL" value="0" <% if cfgs.VHT_BW_SIGNAL == "0" then %> checked="checked"<% end %>/> 禁用
+                    <input type="radio" name="VHT_BW_SIGNAL" value="0" <% if cfgs.VHT_BW_SIGNAL == "2" then %> checked="checked"<% end %>/> Dynamic
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.VHT_LDPC then %>
+            <tr>
+                <td>VHT LDPC</td>
+                <td>
+                    <input type="radio" name="VHT_LDPC" value="1" <% if cfgs.VHT_LDPC == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="VHT_LDPC" value="0" <% if cfgs.VHT_LDPC == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.BGProtection then %>
+            <tr>
+                <td>BG Protection Mode</td>
+                <td>
+                    <select name="BGProtection" style="width:auto">
+                        <option value="0" <% if cfgs.BGProtection == "0" then %>selected="selected"<% end %>>Auto</option>
+                        <option value="1" <% if cfgs.BGProtection == "1" then %>selected="selected"<% end %>>Always On</option>
+                        <option value="2" <% if cfgs.BGProtection == "2" then %>selected="selected"<% end %>>Always Off</option>
+                    </select>
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.VHT_BW then %>
+            <tr>
+                <td>HT Protection</td>
+                <td>
+                    <input type="radio" name="HT_PROTECT" value="1" <% if cfgs.HT_PROTECT == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="HT_PROTECT" value="0" <% if cfgs.HT_PROTECT == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.BeaconPeriod then %>
+            <tr>
+                <td>Beacon Interval</td>
+                <td>
+                    <input name="BeaconPeriod" value="<%=cfgs.BeaconPeriod%>" />ms(范围 20-999, 默认值 100)
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.DtimPeriod then %>
+            <tr>
+                <td>Data Beacon Rate (DTIM)</td>
+                <td>
+                    <input name="DtimPeriod" value="<%=cfgs.DtimPeriod%>" />ms(范围 1-255, 默认值 1)
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.FragThreshold then %>
+            <tr>
+                <td>Fragment Threshold</td>
+                <td>
+                    <input name="FragThreshold" value="<%=cfgs.FragThreshold%>" />(范围 256-2346, 默认值 2346)
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.RTSThreshold then %>
+            <tr>
+                <td>RTS Threshold</td>
+                <td>
+                    <input name="RTSThreshold" value="<%=cfgs.RTSThreshold%>" />(范围 256-2347, 默认值 2347)
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.TxPower then %>
+            <tr>
+                <td>TX Power</td>
+                <td>
+                    <input name="TxPower" value="<%=cfgs.TxPower%>" />dbm(范围 1-100, 默认值 100)
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.TxPreamble then %>
+            <tr>
+                <td>Short Preamble</td>
+                <td>
+                    <input type="radio" name="TxPreamble" value="1" <% if cfgs.TxPreamble == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="TxPreamble" value="0" <% if cfgs.TxPreamble == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.ShortSlot then %>
+            <tr>
+                <td>Short Slot</td>
+                <td>
+                    <input type="radio" name="ShortSlot" value="1" <% if cfgs.ShortSlot == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="ShortSlot" value="0" <% if cfgs.ShortSlot == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.TxBurst then %>
+            <tr>
+                <td>TX Burst</td>
+                <td>
+                    <input type="radio" name="TxBurst" value="1" <% if cfgs.TxBurst == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="TxBurst" value="0" <% if cfgs.TxBurst == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.PktAggregate then %>
+            <tr>
+                <td>Packet Aggregate</td>
+                <td>
+                    <input type="radio" name="PktAggregate" value="1" <% if cfgs.PktAggregate == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="PktAggregate" value="0" <% if cfgs.PktAggregate == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+            <% if cfgs.IEEE80211H then %>
+            <tr>
+                <td>802.11H</td>
+                <td>
+                    <input type="radio" name="IEEE80211H" value="1" <% if cfgs.IEEE80211H == "1" then %> checked="checked"<% end %>/> 启用
+                    <input type="radio" name="IEEE80211H" value="0" <% if cfgs.IEEE80211H == "0" then %> checked="checked"<% end %>/> 禁用
+                </td>
+                <td></td>
+            </tr>
+            <% end %>
+        </table>
+
+
+    </fieldset>
+    <div class="cbi-page-actions">
+        <input class="cbi-button cbi-button-apply" value="重启无线" type="button" onclick='wifi_reload("<%=luci.dispatcher.build_url("admin", "network", "wifi", "reload", devname)%>");' />
+        <input class="cbi-button cbi-button-apply" value="保存设置" type="submit" />
+        <input class="cbi-button cbi-button-apply" name="__apply" value="保存&应用" type="submit" />
+        <input class="cbi-button cbi-button-reset" value="重置" type="reset" />
+    </div>
+</form>
+
+
+<form method="post" name="cbi2" action="<%=luci.dispatcher.build_url("admin", "network", "wifi", "dev_cfg_raw", devname)%>" enctype="multipart/form-data" onreset="return cbi_validate_reset(this)" onsubmit="return cbi_validate_form(this, 'Some fields are invalid, cannot save values!')" autocomplete="off">
+    <fieldset class="cbi-section">
+        <legend> 无线参数(直接修改无线配置)</legend>
+        <p> <span style="color: red"><b>警告</b></span> : 如果你不了解请不要修改!</p>
+        <textarea name="raw" id="raw" style="width:98%; height: 200px;"><%
+            local fd = io.open(dev.profile)
+            for line in fd:lines() do
+                print(line)
+            end
+        %></textarea>
+    </fieldset>
+    <div class="cbi-page-actions">
+        <input class="cbi-button cbi-button-reset" value="重置" onclick="location.href='<%=luci.dispatcher.build_url("admin", "network", "wifi", "dev_cfg_view", devname)%>'" type="button" />
+        <input class="cbi-button cbi-button-apply" id="save" value="保存" type="submit" onclick="if (confirm('你将修改无线参数,确认要修改?')) return true; else return false;" />
+        <input class="cbi-button cbi-button-apply" id="reset" value="恢复出厂设置" type="button" onclick="if (confirm(' 确认恢复<%=devname%> 至出厂设置?')) location.href='<%=luci.dispatcher.build_url("admin", "network", "wifi", "dev_cfg_reset", devname)%>'" />
+    </div>
+</form>
+
+
+<script type="text/javascript">
+    function wifi_reload(url) {
+        window.scrollTo(0, 0);
+        document.getElementById('loading').style.display="";
+        XHR.get(url, null,
+            function(x)
+            {
+                console.log(x);
+                document.getElementById("loading").style.display="none";
+                window.location.reload();
+            }
+        );
+    }
+
+    function WirelessMode_onchange (mode) {
+        var cr = GetCountryRegion(mode);
+
+        getCountryRegionList(mode, cr);
+    }
+
+    function CountryRegion_onchange(country_region) {
+        var wmode_o = document.getElementById('WirelessMode');
+        var wmode;
+
+        if (wmode_o)
+            wmode = wmode_o.value;
+
+        if (wmode == "")
+            wmode = "<%=cfgs.WirelessMode%>";
+
+        getChannelList(wmode, country_region);
+    }
+
+    function Channel_onchange (ch) {
+        getBw(null, ch);
+    }
+
+    function Bw_onchange(bw, ch) {
+        var ch_val;
+
+        if (!ch){
+            var ch_o = document.getElementById('Channel');
+
+            if (ch_o)
+                ch_val = ch_o.value;
+
+            if (ch_val == "")
+                ch_val = "<%=cfgs.Channel%>";
+        } else {
+            ch_val = ch
+        }
+
+        get5G2nd80MhzChannelList(bw, ch_val);
+        getHTExtChannel(bw, ch_val);
+    }
+
+    function initCountryRegionList(list, mode){
+        var select = document.getElementById('__cr');
+        var cr = {};
+
+        if (is_mode_gband(mode))
+            cr = "<%=cfgs.CountryRegion%>";
+        else if (is_mode_aband(mode))
+            cr = "<%=cfgs.CountryRegionABand%>";
+
+        var new_cr = initList(select, list, cr, "region");
+
+        CountryRegion_onchange(new_cr);
+    }
+
+    function getCountryRegionList(mode) {
+        XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_country_region_list")%>', { "mode" : mode },
+            function(x)
+            {
+                //console.log(x);
+                //console.log(x.response);
+                var json = eval(x.response);
+                initCountryRegionList(json, mode);
+            }
+        );
+    }
+
+    function initChannelList(list) {
+        /* choose auto select when no matching item in the lis */
+        var select = document.getElementById('Channel');
+        var ch = {};
+        var new_ch = null;
+
+        ch.cval = select.value;
+        ch.oval = "<%=dev.Channel%>";
+
+        var new_ch = initList(select, list, ch, "channel");
+        Channel_onchange(new_ch);
+    }
+
+    function getChannelList(mode, country_region) {
+        XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_channel_list")%>', { "mode" : mode, "country_region" : country_region },
+            function(x)
+            {
+                console.log(x);
+                console.log(x.response);
+                var json = eval(x.response);
+                initChannelList(json);
+            }
+        );
+    }
+
+    function GetCountryRegion(mode) {
+        var cr_o = document.getElementById('__cr');
+        var cr = "";
+
+        if (cr_o) {
+            cr = cr_o.value;
+        }
+
+        if (cr == "") {
+            if (is_mode_gband(mode)) {
+                cr = "<%=cfgs.CountryRegion%>";
+            } else if (is_mode_aband(mode)) {
+                cr = "<%=cfgs.CountryRegionABand%>";
+            } else {
+                alert("Cannot get valid CountryRegion from invalid WireleeMode");
+            }
+        }
+
+        return cr;
+    }
+
+    function getBw(mode, ch) {
+        /* choose bw as wide as possible if modification is needed */
+        var bw_sel = document.getElementById('__bw');
+        var wmode;
+
+        if (!mode) {
+            wmode = document.getElementById('WirelessMode');
+            wmode = wmode.value*1;
+        } else {
+            wmode = mode*1;
+        }
+
+        if (is_mode_legacy_only(wmode)) {
+            for (var idx in bw_sel.options) {
+                bw_sel.options[idx].disabled = false;
+
+                if (bw_sel.options[idx].value == 20)
+                    bw_sel.options[idx].selected = true;
+
+                if (bw_sel.options[idx].value > 20)
+                    bw_sel.options[idx].disabled = true;
+            }
+        } else if (is_ch_gband(ch)) {
+            for (var idx in bw_sel.options) {
+                bw_sel.options[idx].disabled = false;
+
+                if ((bw_sel.options[idx].value == 60) && (bw_sel.selectedIndex > idx))
+                    bw_sel.options[idx].selected = true;
+
+                if (bw_sel.options[idx].value > 60)
+                    bw_sel.options[idx].disabled = true;
+            }
+        } else if (is_ch_aband(ch)) {
+            var chosen60 = false;
+            var bw160 = "<%=cfgs.VHT_BW%>"*1;
+
+            if (bw_sel.value == 60)
+                chosen60 = 1;
+
+            for (var idx in bw_sel.options) {
+                bw_sel.options[idx].disabled = false;
+
+                if (bw_sel.options[idx].value == 40 && chosen60 && bw160 == 0) {
+                    bw_sel.options[idx].selected = true;
+                } else if (bw_sel.options[idx].value == 60) {
+                    bw_sel.options[idx].disabled = true;
+                        bw_sel.options[idx].selected = false;
+                } else if (bw_sel.options[idx].value == 160 && chosen60 && bw160 == 1) {
+                    bw_sel.options[idx].selected = true;
+                }
+            }
+        }
+
+        Bw_onchange(bw_sel.value, ch);
+    }
+
+    function init5G2nd80MhzChannelList(list) {
+        var select = document.getElementById('VHT_Sec80_Channel');
+        var ch2 = {};
+        var new_ch2 = null;
+
+        ch2.cval = select.value;
+        ch2.oval = "<%=cfgs.VHT_Sec80_Channel%>";
+
+        initList(select, list, ch2, "channel");
+
+        if (select.length > 0)
+            select.disabled = false;
+        else
+            alert("[Warning] 5G 2nd 80Mhz Channel is not available. Please Check CountryRegion.");
+    }
+
+    function get5G2nd80MhzChannelList(bw, ch) {
+        var ch_5g_2nd = document.getElementById('VHT_Sec80_Channel');
+
+            ch_5g_2nd.disabled = true;
+
+        if (ch == "0")
+            return;
+
+        if (bw != "161" || ch == "0")
+            return;
+
+        var mode = document.getElementById('WirelessMode');
+        mode = mode.value*1;
+
+        var cr = GetCountryRegion(mode);
+        XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_5G_2nd_80Mhz_channel_list")%>', { "ch_cur" : ch, "country_region" : cr },
+            function(x)
+            {
+                //console.log(x);
+                //console.log(x.response);
+                var json = eval(x.response);
+                init5G2nd80MhzChannelList(json);
+            }
+        );
+        }
+
+    function initHTExtChannelList(list) {
+        var select = document.getElementById('HT_EXTCHA');
+        var ch2 = {};
+        var new_ch2 = null;
+
+        ch2.cval = select.value;
+        ch2.oval = "<%=cfgs.HT_EXTCHA%>";
+
+        initList(select, list, ch2, "val");
+
+        if (select.length > 0)
+            select.disabled = false;
+        else
+            alert("[Warning] 2G 40Mhz Ext Channel is not avalable. Please Check CountryRegion.");
+        }
+
+    function getHTExtChannel(bw, ch) {
+        var ch_2g_ext = document.getElementById('HT_EXTCHA');
+
+        ch_2g_ext.disabled = true;
+
+        if (ch == "0")
+            return;
+
+        if (bw != "40" && bw != "60")
+            return;
+
+        var mode = document.getElementById('WirelessMode');
+        mode = mode.value*1;
+
+        var cr = GetCountryRegion(mode);
+        XHR.get('<%=luci.dispatcher.build_url("admin", "network", "wifi", "get_HT_ext_channel_list")%>', { "ch_cur" : ch, "country_region" : cr },
+            function(x)
+            {
+                console.log(x);
+                console.log(x.response);
+                var json = eval(x.response);
+                initHTExtChannelList(json);
+            }
+        );
+    }
+
+    function toggle_apcli (show) {
+        if (show) {
+            document.getElementById('apcli_cfg').style.display = "";
+
+            var a = document.getElementById('ApCliAuthMode')
+            var to = a.options[a.options.selectedIndex].value
+            if (to == "WPA2PSK") {
+                document.getElementById("apcli_wpa").style.display="";
+                document.getElementById("apcli_wep").style.display="none";
+            } else if (to == "WEP") {
+                document.getElementById("apcli_wpa").style.display="none";
+                document.getElementById("apcli_wep").style.display="";
+            } else {
+                document.getElementById("apcli_wpa").style.display="none";
+                document.getElementById("apcli_wep").style.display="none";
+            }
+        }
+        else {
+            document.getElementById('apcli_cfg').style.display = "none";
+            document.getElementById('apcli_wpa').style.display = "none";
+            document.getElementById('apcli_wep').style.display = "none";
+        }
+    }
+
+    function ApCliAuthMode_onchange (to) {
+        if (to == "WPA2PSK") {
+            document.getElementById("apcli_wpa").style.display="";
+            document.getElementById("apcli_wep").style.display="none";
+        } else if (to == "WEP") {
+            document.getElementById("apcli_wpa").style.display="none";
+            document.getElementById("apcli_wep").style.display="";
+        } else {
+            document.getElementById("apcli_wpa").style.display="none";
+            document.getElementById("apcli_wep").style.display="none";
+        }
+    }
+
+    function toggle_atf(o) {
+        if (o.getAttribute("value") == "1") {
+            document.getElementById("VOW_Airtime_Fairness_En").value = "0";
+            o.setAttribute("value", "0");
+            o.className = "cbi-button cbi-button-add";
+            o.innerHTML = "Enable ATC";
+        } else {
+            document.getElementById("VOW_Airtime_Fairness_En").value = "1";
+            o.setAttribute("value", "1");
+            o.className = "cbi-button cbi-button-remove";
+            o.innerHTML = "Disable ATC";
+        }
+    }
+
+    function toggle_atc(o) {
+        if (o.getAttribute("value") == "1") {
+            document.getElementById("VOW_BW_Ctrl").value = "0";
+            o.setAttribute("value", "0");
+            o.className = "cbi-button cbi-button-add";
+            o.innerHTML = "Enable ATC";
+            document.getElementById("atc-table").style.display = "none";
+        } else {
+            document.getElementById("VOW_BW_Ctrl").value = "1";
+            o.setAttribute("value", "1");
+            o.className = "cbi-button cbi-button-remove";
+            o.innerHTML = "Disable ATC";
+            document.getElementById("atc-table").style.display = "";
+        }
+    }
+
+    function is_mode_legacy_only(mode) {
+        var imode = mode*1;
+
+        return ((imode >= 0) && (imode <= 4));
+    }
+
+    function is_mode_gband(mode) {
+        var imode = mode*1;
+        var gband_mode_list = [0,1,4,6,7,9];
+        var i;
+
+        for (i = 0; i < gband_mode_list.length; i++){
+            if( gband_mode_list[i] == imode )
+                return true;
+        }
+
+        return false;
+    }
+
+    function is_mode_aband(mode) {
+        var imode = mode*1;
+        var aband_mode_list = [2,8,11,14,15];
+        var i;
+
+        for (i = 0; i < aband_mode_list.length; i++){
+            if( aband_mode_list[i] == imode )
+                return true;
+        }
+
+        return false;
+    }
+
+    function is_ch_gband(ch) {
+        ch = ch*1;
+
+        if (ch == 0) {
+            var wmode = document.getElementById('WirelessMode');
+
+            return is_mode_gband(wmode.value);
+        }
+
+        return ((ch > 0) && (ch <= 14));
+    }
+
+    function is_ch_aband(ch) {
+        ch = ch*1;
+
+        if (ch == 0) {
+            var wmode = document.getElementById('WirelessMode');
+
+            return is_mode_aband(wmode.value);
+        }
+
+        return ((ch >= 36 ) && (ch <= 165));
+    }
+
+    function initList(selobj, list, selvals, value, text){
+        var sel = {};
+        var id = selobj.id;
+
+        if (typeof(selvals) != "object")
+            sel[0] = selvals;
+        else
+            sel = selvals;
+
+        selobj.innerHTML = "";
+        for (var i in list) {
+            var opt = document.createElement('option');
+
+            if(value)
+                opt.value = list[i][value];
+            else
+                opt.value = list[i].value;
+
+            if(text)
+                opt.text = list[i][text];
+            else
+                opt.text = list[i].text;
+
+            selobj.appendChild(opt);
+        }
+
+        var selv = null;
+        for (var k in sel) {
+            //console.log("[initList][" + id + "] sel[" + k + "]=" + sel[k]);
+            for (var i in selobj.options){
+                if (selobj.options[i].value == sel[k]){
+                    selobj.options[i].selected = true;
+                    selv = sel[k];
+                    //console.log("[initList][" + id + "] found selv=" + selv);
+                    break;
+                }
+            }
+
+            if (selv) break;
+        }
+
+        if (!selv) {
+            selv = selobj.value;
+            //console.log("[initList][" + id + "] !selv, selv=" + selv);
+        }
+
+        return selv;
+    }
+
+    window.onload = function() {
+        WirelessMode_onchange('<%=dev.WirelessMode%>');
+        ApCliAuthMode_onchange('<%=cfgs.ApCliAuthMode%>');
+    }
+
+</script>
+
+<%+footer%>

BIN
XY-C5/files/www/luci-static/resources/icons/wifi_big.png


+ 11 - 0
XY-C5/settings.ini

@@ -0,0 +1,11 @@
+REPO_URL="https://github.com/openwrt/openwrt"
+REPO_BRANCH="master"
+CONFIG_FILE=".config"
+DIY_SH="diy.sh"
+FREE_UP_DISK="true"
+SSH_ACTIONS="false"
+UPLOAD_BIN_DIR_FOR_ARTIFACT="false"
+UPLOAD_FIRMWARE_FOR_ARTIFACT="true"
+UPLOAD_FIRMWARE_FOR_RELEASE="true"
+UPLOAD_FIRMWARE_TO_COWTRANSFER="false"
+UPLOAD_FIRMWARE_TO_WETRANSFER="true"