diff --git a/luci-app-passwall2/Makefile b/luci-app-passwall2/Makefile index b0be767d..eab1315c 100644 --- a/luci-app-passwall2/Makefile +++ b/luci-app-passwall2/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-passwall2 PKG_VERSION:=26.7.16 -PKG_RELEASE:=66 +PKG_RELEASE:=67 PKG_PO_VERSION:=$(PKG_VERSION) PKG_CONFIG_DEPENDS:= \ diff --git a/luci-app-passwall2/root/usr/share/passwall2/nftables.sh b/luci-app-passwall2/root/usr/share/passwall2/nftables.sh index ab272b81..d518a4d8 100755 --- a/luci-app-passwall2/root/usr/share/passwall2/nftables.sh +++ b/luci-app-passwall2/root/usr/share/passwall2/nftables.sh @@ -205,7 +205,9 @@ gen_nftset() { nft "add set $NFTABLE_NAME $nftset_name { type $ip_type; flags interval, timeout; timeout $timeout_argument_set; gc-interval $gc_interval_time; auto-merge; }" fi fi - [ $# -gt 0 ] || [ ! -t 0 ] && insert_nftset "$nftset_name" "$timeout_argument_element" "$@" + if [ $# -gt 0 ]; then + insert_nftset "$nftset_name" "$timeout_argument_element" "$@" + fi } gen_shunt_list() { 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 eed67b24..ced845b9 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 @@ -1214,7 +1214,7 @@ function getAssocListForNetwork(radioNet) { })); } -function getCachedAssocListForNetwork(radioNet) { +function getCachedAssocListForNetwork(radioNet, waitForRefresh) { const key = radioNet.getName(); if (pendingAssocLists[key] == null) { @@ -1225,6 +1225,9 @@ function getCachedAssocListForNetwork(radioNet) { }); } + if (waitForRefresh) + return pendingAssocLists[key].then(() => cachedAssocLists[key] || []); + return Promise.resolve(cachedAssocLists[key] || []); } @@ -4695,8 +4698,14 @@ return view.extend({ }; return m.render().then(L.bind(function(m, nodes) { + let initialAssocRefresh = true; + poll.add(L.bind(function() { const tasks = [ network.getHostHints(), network.getWifiDevices() ]; + const waitForAssocRefresh = initialAssocRefresh; + const iwinfoResolverTask = areQcaRuntimeProbesSuspended() + ? Promise.resolve() + : loadIwinfoResolver(false); startIwinfoInfoRefresh(); @@ -4734,28 +4743,31 @@ return view.extend({ }); }, network)) .then(L.bind(function(hosts_radios_wifis) { - const tasks = []; - const section = m?.children?.[0]; + return iwinfoResolverTask.then(() => { + const tasks = []; + const section = m?.children?.[0]; - if (section != null) { - section.radios = hosts_radios_wifis[1]; - section.wifis = hosts_radios_wifis[2]; - } - - hosts_radios_wifis[2].forEach(hrw => tasks.push(getCachedAssocListForNetwork(hrw)) ); - - return Promise.all(tasks).then(function(data) { - hosts_radios_wifis[3] = []; - - for (let i = 0; i < data.length; i++) { - const wifiNetwork = hosts_radios_wifis[2][i]; - const radioDev = hosts_radios_wifis[1].filter(function(d) { return d.getName() == wifiNetwork.getWifiDeviceName(); })[0]; - - for (let dy of data[i]) - hosts_radios_wifis[3].push(Object.assign({ radio: radioDev, network: wifiNetwork }, dy)); + if (section != null) { + section.radios = hosts_radios_wifis[1]; + section.wifis = hosts_radios_wifis[2]; } - return hosts_radios_wifis; + hosts_radios_wifis[2].forEach(hrw => tasks.push(getCachedAssocListForNetwork(hrw, waitForAssocRefresh)) ); + + return Promise.all(tasks).then(function(data) { + initialAssocRefresh = false; + hosts_radios_wifis[3] = []; + + for (let i = 0; i < data.length; i++) { + const wifiNetwork = hosts_radios_wifis[2][i]; + const radioDev = hosts_radios_wifis[1].filter(function(d) { return d.getName() == wifiNetwork.getWifiDeviceName(); })[0]; + + for (let dy of data[i]) + hosts_radios_wifis[3].push(Object.assign({ radio: radioDev, network: wifiNetwork }, dy)); + } + + return hosts_radios_wifis; + }); }); }, network)) .then(L.bind(function(zones, data) {