update 2025-09-13 00:23:31

This commit is contained in:
kenzok8
2025-09-13 00:23:31 +08:00
parent bba977568f
commit 5be145b433
2 changed files with 13 additions and 12 deletions

View File

@@ -55,22 +55,18 @@ local api = require "luci.passwall.api"
"gfwlist_update","chnroute_update","chnroute6_update",
"chnlist_update","geoip_update","geosite_update"
];
const targetNode = document.querySelector('form') || document.body;
const observer = new MutationObserver(() => {
const bindFlags = () => {
let allBound = true;
flags.forEach(flag => {
const orig = Array.from(document.querySelectorAll(`input[name$=".${flag}"]`)).find(i => i.type === 'checkbox');
if (!orig) {
return;
}
if (!orig) { allBound = false; return; }
// 隐藏最外层 div
const wrapper = orig.closest('.cbi-value');
if (wrapper && wrapper.style.display !== 'none') {
wrapper.style.display = 'none';
}
const custom = document.querySelector(`.cbi-input-checkbox[name="${flag.replace('_update','')}"]`);
if (!custom) {
return;
}
if (!custom) { allBound = false; return; }
custom.checked = orig.checked;
// 自定义选择框与原生Flag双向绑定
if (!custom._binded) {
@@ -84,8 +80,13 @@ local api = require "luci.passwall.api"
});
}
});
});
observer.observe(targetNode, { childList: true, subtree: true });
return allBound;
};
const target = document.querySelector('form') || document.body;
const observer = new MutationObserver(() => bindFlags() ? observer.disconnect() : 0);
observer.observe(target, { childList: true, subtree: true });
const timer = setInterval(() => bindFlags() ? (clearInterval(timer), observer.disconnect()) : 0, 300);
setTimeout(() => { clearInterval(timer); observer.disconnect(); }, 5000);
});
function update_rules(btn) {

View File

@@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=natflow
PKG_VERSION:=20250831
PKG_VERSION:=20250912
PKG_SOURCE_URL:=https://codeload.github.com/ptpt52/natflow/tar.gz/$(PKG_VERSION)?
PKG_HASH:=b4537ba11af920548f657990826495de207122651a2d082641666b60436b801e
PKG_HASH:=e3d2e97841effbca841a34e39f6f0b2c5ba71b8af98476d8c2d4b0b158c5f6ed
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_MAINTAINER:=Chen Minqiang <ptpt52@gmail.com>