From 767a6aeb984ab3475fcde2876e0fcbe92abad585 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 28 Apr 2026 00:03:12 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20Sync=202026-04-28=2000:03:12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- luci-app-passwall/Makefile | 2 +- luci-app-passwall/luasrc/passwall/api.lua | 14 ++++ .../luasrc/passwall/util_sing-box.lua | 2 +- .../luasrc/passwall/util_xray.lua | 2 +- .../share/passwall/helper_chinadns_add.lua | 2 +- .../usr/share/passwall/helper_dnsmasq.lua | 2 +- .../share/passwall/helper_smartdns_add.lua | 2 +- .../resources/view/network/wireless.js | 70 ++++++++++++++++--- 8 files changed, 79 insertions(+), 17 deletions(-) diff --git a/luci-app-passwall/Makefile b/luci-app-passwall/Makefile index 0a30ebd1d..d95ad9331 100644 --- a/luci-app-passwall/Makefile +++ b/luci-app-passwall/Makefile @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall PKG_VERSION:=26.4.15 -PKG_RELEASE:=99 +PKG_RELEASE:=100 PKG_PO_VERSION:=$(PKG_VERSION) PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall/luasrc/passwall/api.lua b/luci-app-passwall/luasrc/passwall/api.lua index cff5ae027..1e91681d3 100644 --- a/luci-app-passwall/luasrc/passwall/api.lua +++ b/luci-app-passwall/luasrc/passwall/api.lua @@ -1555,3 +1555,17 @@ function fetch_cert_sha256(host, port, timeout) if not fp then return "" end return fp:upper() end + +function vps_domain_exclude(domain) + if trim(domain) == "" then return true end + local map = { + ["engage.cloudflareclient.com"] = 1, + ["google.com"] = 1, ["www.google.com"] = 1, + ["youtube.com"] = 1, ["www.youtube.com"] = 1, + ["github.com"] = 1, ["telegram.org"] = 1, + ["cloudflare.com"] = 1, ["www.cloudflare.com"] = 1, + ["bing.com"] = 1, ["www.bing.com"] = 1, ["x.com"] = 1 + } + if map[domain] then return true end + return false +end diff --git a/luci-app-passwall/luasrc/passwall/util_sing-box.lua b/luci-app-passwall/luasrc/passwall/util_sing-box.lua index 5ec65fd50..d7db72e66 100644 --- a/luci-app-passwall/luasrc/passwall/util_sing-box.lua +++ b/luci-app-passwall/luasrc/passwall/util_sing-box.lua @@ -1828,7 +1828,7 @@ function gen_config(var) local domain = {} local nodes_domain_text = sys.exec([[uci show passwall | sed -n "s/.*\.address='\([^']*\)'/\1/p" | sort -u]]) string.gsub(nodes_domain_text, '[^' .. "\r\n" .. ']+', function(w) - if w and w ~= "" and api.datatypes.hostname(w) and not GLOBAL.VPS_EXCLUDE[w] then + if not api.vps_domain_exclude(w) and api.datatypes.hostname(w) and not GLOBAL.VPS_EXCLUDE[w] then table.insert(domain, w) end end) diff --git a/luci-app-passwall/luasrc/passwall/util_xray.lua b/luci-app-passwall/luasrc/passwall/util_xray.lua index 89568aa9f..4c017f210 100644 --- a/luci-app-passwall/luasrc/passwall/util_xray.lua +++ b/luci-app-passwall/luasrc/passwall/util_xray.lua @@ -1545,7 +1545,7 @@ function gen_config(var) local domain = {} local nodes_domain_text = sys.exec([[uci show passwall | sed -n "s/.*\.\(address\|download_address\)='\([^']*\)'/\2/p" | sort -u]]) string.gsub(nodes_domain_text, '[^' .. "\r\n" .. ']+', function(w) - if w and w ~= "" and api.datatypes.hostname(w) and not GLOBAL.VPS_EXCLUDE[w] then + if not api.vps_domain_exclude(w) and api.datatypes.hostname(w) and not GLOBAL.VPS_EXCLUDE[w] then table.insert(domain, "full:" .. w) end end) diff --git a/luci-app-passwall/root/usr/share/passwall/helper_chinadns_add.lua b/luci-app-passwall/root/usr/share/passwall/helper_chinadns_add.lua index 5bd54078d..139e49b88 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_chinadns_add.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_chinadns_add.lua @@ -173,7 +173,7 @@ if not is_file_nonzero(file_vpslist) then local f_out = io.open(file_vpslist, "w") local written_domains = {} local function process_address(address) - if address == "engage.cloudflareclient.com" then return end + if api.vps_domain_exclude(address) then return end if datatypes.hostname(address) and not written_domains[address] then f_out:write(address .. "\n") written_domains[address] = true diff --git a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua index 188f1334c..be450cb69 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq.lua @@ -371,7 +371,7 @@ function add_rule(var) setflag_6 .. "passwall_vps6" } local function process_address(address) - if address == "engage.cloudflareclient.com" then return end + if api.vps_domain_exclude(address) then return end if datatypes.hostname(address) then set_domain_dns(address, fwd_dns) set_domain_ipset(address, table.concat(sets, ",")) diff --git a/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua b/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua index 00e1cd9e4..94ec7ed28 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_smartdns_add.lua @@ -333,7 +333,7 @@ if not is_file_nonzero(file_vpslist) then local f_out = io.open(file_vpslist, "w") local written_domains = {} local function process_address(address) - if address == "engage.cloudflareclient.com" then return end + if api.vps_domain_exclude(address) then return end if datatypes.hostname(address) and not written_domains[address] then f_out:write(address .. "\n") written_domains[address] = true diff --git a/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js b/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js index a91cbc2c0..0e46558e6 100644 --- a/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js +++ b/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js @@ -643,18 +643,50 @@ function getDisplayCountryCode(radioNet) { return radioNet.getCountryCode() || uci.get('wireless', radioNet.getWifiDeviceName(), 'country') || '00'; } -function getConfiguredBand(hwtype, hwmode, channel, bandval) { +function normalizeQcaBandValue(bandval) { + switch (String(bandval ?? '')) { + case '1': + return '2g'; + case '2': + return '5g'; + case '3': + return '6g'; + default: + return String(bandval || ''); + } +} + +function getQcaBandCode(band) { + switch (String(band || '')) { + case '2g': + return '1'; + case '5g': + return '2'; + case '6g': + return '3'; + default: + return null; + } +} + +function getConfiguredBand(hwtype, hwmode, channel, bandval, htmode) { hwmode = String(hwmode || ''); - bandval = String(bandval || ''); + htmode = String(htmode || ''); + bandval = isQcaWifiHwtype(hwtype) ? normalizeQcaBandValue(bandval) : String(bandval || ''); channel = +channel; if (bandval) return bandval; - if (/^11bea/.test(hwmode)) + if (/^11bea/.test(hwmode)) { + if (/^(?:HT|EHT)320$/.test(htmode)) + return '6g'; + return (!isNaN(channel) && channel > 0 && channel < 36) ? '6g' : '5g'; + } + if (/^11axa/.test(hwmode)) return (!isNaN(channel) && channel > 0 && channel < 36) ? '6g' : '5g'; if (/^11beg|^11axg|^11ng|^11g|^11b/.test(hwmode)) return '2g'; - if (/^11ac|^11axa|^11na|^11a/.test(hwmode)) + if (/^11ac|^11na|^11a/.test(hwmode)) return '5g'; if (/a/.test(hwmode)) return '5g'; @@ -717,8 +749,18 @@ function getFrequencyListBand(entry, hwmode) { return '6g'; } - if (band == 2 || band == 5 || band == 6 || band == 60) - return '%dg'.format(band); + switch (band) { + case 1: + return '2g'; + case 2: + case 5: + return '5g'; + case 3: + case 6: + return '6g'; + case 60: + return '60g'; + } return null; } @@ -1542,7 +1584,7 @@ var CBIWifiFrequencyValue = form.Value.extend({ } } - const configured_band = getConfiguredBand(hwtype, statuscfg.hwmode ?? hwval, devcfg.channel ?? cfg_channel, devcfg.band ?? bandval); + const configured_band = getConfiguredBand(hwtype, statuscfg.hwmode ?? hwval, devcfg.channel ?? cfg_channel, devcfg.band ?? bandval, statuscfg.htmode ?? htval); const has_band_channels = (band) => { const channels = this.channels[band]; const offset = (channels?.[0] == 'auto') ? 3 : 0; @@ -1657,7 +1699,8 @@ var CBIWifiFrequencyValue = form.Value.extend({ 'ac': [ '5g', '5 GHz', { available: has_band_channels('5g') } ], 'ax': [ '2g', '2.4 GHz', { available: has_band_channels('2g') }, - '5g', '5 GHz', { available: has_band_channels('5g') } + '5g', '5 GHz', { available: has_band_channels('5g') }, + '6g', '6 GHz', { available: has_band_channels('6g') } ], 'be': [ '2g', '2.4 GHz', { available: has_band_channels('2g') }, @@ -1919,7 +1962,7 @@ var CBIWifiFrequencyValue = form.Value.extend({ const htval = isQcaWifiHwtype(hwtype) ? (cfg_htval || devinfo.htmode) : (devinfo.htmode || cfg_htval); const hwval = isQcaWifiHwtype(hwtype) ? (cfg_hwval || devinfo.hwmode) : (devinfo.hwmode || cfg_hwval); const chval = cfg_chval || devinfo.channel; - const bandval = cfg_bandval || getConfiguredBand(hwtype, hwval, chval, null); + const bandval = cfg_bandval || getConfiguredBand(hwtype, hwval, chval, null, htval); const forceSelectValue = function(sel, value) { if (value == null) return false; @@ -1961,7 +2004,7 @@ var CBIWifiFrequencyValue = form.Value.extend({ if (isQcaWifiHwtype(hwtype)) { this.useBandOption = true; - this.setSelectValue(band, getConfiguredBand(hwtype, hwval, chval, bandval)); + this.setSelectValue(band, getConfiguredBand(hwtype, hwval, chval, bandval, htval)); } else if (hwtype == 'mac80211') { this.useBandOption = true; @@ -2090,6 +2133,7 @@ var CBIWifiFrequencyValue = form.Value.extend({ if (isQcaWifiHwtype(hwtype)) { let hwmode = getValue('hwmode'); + const qcaBand = (hwtype == 'qcawificfg80211') ? getQcaBandCode(band) : null; if (hwtype == 'qcawifi') { if (mode == 'ac') @@ -2115,7 +2159,11 @@ var CBIWifiFrequencyValue = form.Value.extend({ } setValue('hwmode', hwmode); - unsetValue('band'); + + if (hwtype == 'qcawificfg80211' && qcaBand != null) + setValue('band', qcaBand); + else + unsetValue('band'); } else if (this.useBandOption) { setValue('band', band);