Update version to 1.17 in ZapretManager_LuCI.sh

This commit is contained in:
StressOzz authored and GitHub committed 2026-09-19 18:50:16 +05:00
1 parent 4e02b738d5
commit 7e55cefb4c
1 file changed
+21 -4
+21 -4
View File
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Zapret Manager by StressOzz for LuCI installer # Zapret Manager by StressOzz for LuCI installer
# Version: 1.16 # Version: 1.17
set -e set -e
GREEN="\033[1;32m"; CYAN="\033[1;36m"; YELLOW="\033[1;33m"; MAGENTA="\033[1;35m"; BLUE="\033[0;34m"; NC="\033[0m"; DGRAY="\033[38;5;244m" GREEN="\033[1;32m"; CYAN="\033[1;36m"; YELLOW="\033[1;33m"; MAGENTA="\033[1;35m"; BLUE="\033[0;34m"; NC="\033[0m"; DGRAY="\033[38;5;244m"
@@ -26,7 +26,7 @@ mkdir -p /usr/lib/zapret-manager
cat > '/usr/lib/zapret-manager/backend.sh' << 'ZM_INSTALLER_EOF' cat > '/usr/lib/zapret-manager/backend.sh' << 'ZM_INSTALLER_EOF'
CONF="/etc/config/zapret" CONF="/etc/config/zapret"
ZM_VERSION="1.16" ZM_VERSION="1.17"
ZM_SCRIPT_URL="https://raw.githubusercontent.com/StressOzz/Zapret-Manager/refs/heads/main/ZapretManager_LuCI.sh" ZM_SCRIPT_URL="https://raw.githubusercontent.com/StressOzz/Zapret-Manager/refs/heads/main/ZapretManager_LuCI.sh"
GH_RAW="https://raw.githubusercontent.com" GH_RAW="https://raw.githubusercontent.com"
GH_MAIN="https://github.com" GH_MAIN="https://github.com"
@@ -4928,8 +4928,7 @@ return view.extend({
presetBusy = false; presetBusy = false;
if (res.error) { zm.toast(res.error, 'error'); return; } if (res.error) { zm.toast(res.error, 'error'); return; }
zm.toast('Список применён: ' + p.label, 'info'); zm.toast('Список применён: ' + p.label, 'info');
zm.mixomoStatus().then(renderPresets); waitForListAppliedThenRefresh(p.id);
setTimeout(refreshMtEmbed, 1500);
}).catch(function() { presetBusy = false; }); }).catch(function() { presetBusy = false; });
} }
}, p.label); }, p.label);
@@ -4941,6 +4940,24 @@ return view.extend({
if (mtFrame) { mtFrame.src = mtFrame.src.split('?')[0] + '?_r=' + Date.now(); } if (mtFrame) { mtFrame.src = mtFrame.src.split('?')[0] + '?_r=' + Date.now(); }
} }
function waitForListAppliedThenRefresh(presetId) {
var attempts = 0;
var maxAttempts = 20;
var timer = setInterval(function() {
attempts++;
zm.mixomoStatus().then(function(d) {
renderPresets(d);
if (d.magitrickle_list === presetId) {
clearInterval(timer);
refreshMtEmbed();
} else if (attempts >= maxAttempts) {
clearInterval(timer);
refreshMtEmbed();
}
});
}, 500);
}
function renderEmbed(d) { function renderEmbed(d) {
embedCard.innerHTML = ''; embedCard.innerHTML = '';
embedCard.appendChild(E('h3', {}, 'Окно MagiTrickle')); embedCard.appendChild(E('h3', {}, 'Окно MagiTrickle'));