Update ZapretManager_LuCI.sh
This commit is contained in:
1 parent
4c488e069f
commit
592463ad92
1 file changed
+17
-10
+17
-10
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Zapret Manager by StressOzz for LuCI installer
|
# Zapret Manager by StressOzz for LuCI installer
|
||||||
# Version: 1.23
|
# Version: 1.24
|
||||||
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"
|
||||||
@@ -19,7 +19,7 @@ chmod 0755 /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.23"
|
ZM_VERSION="1.24"
|
||||||
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"
|
||||||
@@ -4552,18 +4552,25 @@ return view.extend({
|
|||||||
}
|
}
|
||||||
renderGeoGrid();
|
renderGeoGrid();
|
||||||
|
|
||||||
var resetBtn = E('button', { 'class': 'cbi-button cbi-button-remove', 'click': resetHosts }, 'Восстановить hosts');
|
|
||||||
|
|
||||||
var geoCard = E('div', { 'class': 'zm-card' }, [
|
var geoCard = E('div', { 'class': 'zm-card' }, [
|
||||||
E('h3', {}, 'Заменить hosts на GeoHide'),
|
E('h3', {}, 'Заменить hosts на GeoHide'),
|
||||||
E('p', { 'class': 'zm-hint' }, 'Внимание: это ПОЛНОСТЬЮ заменит файл /etc/hosts на список от GeoHide DNS — все блоки выше и любые ваши собственные записи будут удалены.'),
|
E('p', { 'class': 'zm-hint' }, 'Внимание: это ПОЛНОСТЬЮ заменит файл /etc/hosts на список от GeoHide DNS — все блоки выше и любые ваши собственные записи будут удалены.'),
|
||||||
geoGrid,
|
geoGrid,
|
||||||
E('p', { 'class': 'zm-hint' }, 'Или восстановить hosts к чистому виду. Уберёт и блоки выше, и GeoHide.'),
|
|
||||||
E('div', { 'class': 'zm-actions' }, [ resetBtn ]),
|
|
||||||
geoLogEl
|
geoLogEl
|
||||||
]);
|
]);
|
||||||
wrap.appendChild(geoCard);
|
wrap.appendChild(geoCard);
|
||||||
|
|
||||||
|
var resetLogEl = E('pre', { 'class': 'zm-log' });
|
||||||
|
var resetBtn = E('button', { 'class': 'cbi-button cbi-button-remove', 'click': resetHosts }, 'Восстановить hosts');
|
||||||
|
|
||||||
|
var resetCard = E('div', { 'class': 'zm-card' }, [
|
||||||
|
E('h3', {}, 'Восстановить hosts'),
|
||||||
|
E('p', { 'class': 'zm-hint' }, 'Вернёт /etc/hosts к чистому виду — уберёт и блоки выше, и GeoHide, и всё, что было добавлено вручную.'),
|
||||||
|
E('div', { 'class': 'zm-actions' }, [ resetBtn ]),
|
||||||
|
resetLogEl
|
||||||
|
]);
|
||||||
|
wrap.appendChild(resetCard);
|
||||||
|
|
||||||
function refreshAll() {
|
function refreshAll() {
|
||||||
zm.hostsStatus().then(function(res) {
|
zm.hostsStatus().then(function(res) {
|
||||||
data = res;
|
data = res;
|
||||||
@@ -4591,12 +4598,12 @@ return view.extend({
|
|||||||
if (busy) { zm.toast('Дождитесь завершения текущей операции', 'warning'); return; }
|
if (busy) { zm.toast('Дождитесь завершения текущей операции', 'warning'); return; }
|
||||||
busy = true;
|
busy = true;
|
||||||
zm.toast('Восстанавливаем hosts', 'warning');
|
zm.toast('Восстанавливаем hosts', 'warning');
|
||||||
geoLogEl.classList.add('zm-show');
|
resetLogEl.classList.add('zm-show');
|
||||||
zm.renderLog(geoLogEl, '==> Восстанавливаем hosts');
|
zm.renderLog(resetLogEl, '==> Восстанавливаем hosts');
|
||||||
zm.hostsReset().then(function(res) {
|
zm.hostsReset().then(function(res) {
|
||||||
busy = false;
|
busy = false;
|
||||||
if (res.error) { zm.renderLog(geoLogEl, '==> ОШИБКА: ' + res.error); zm.toast(res.error, 'error'); return; }
|
if (res.error) { zm.renderLog(resetLogEl, '==> ОШИБКА: ' + res.error); zm.toast(res.error, 'error'); return; }
|
||||||
zm.renderLog(geoLogEl, '==> Готово — hosts восстановлен.');
|
zm.renderLog(resetLogEl, '==> Готово — hosts восстановлен.');
|
||||||
zm.toast('hosts восстановлен', 'info');
|
zm.toast('hosts восстановлен', 'info');
|
||||||
refreshAll();
|
refreshAll();
|
||||||
}).catch(function() { busy = false; });
|
}).catch(function() { busy = false; });
|
||||||
|
|||||||
Reference in new issue
Block a user