feat: локализация исключений GeoIP по секциям и мониторинг памяти DNS-кэша dnsmasq
This commit is contained in:
@@ -6772,7 +6772,11 @@ function applyServiceState(uiState) {
|
||||
tachyonStatus: uiState.service.tachyon.status,
|
||||
watchdogRunning: store.get().servicesInfoWidget.data.watchdogRunning,
|
||||
zapret2Running: uiState.service.zapret2 ? uiState.service.zapret2.running : void 0,
|
||||
zapret2MemoryMb: uiState.service.zapret2 ? uiState.service.zapret2.memory_rss_mb : void 0
|
||||
zapret2MemoryMb: uiState.service.zapret2 ? uiState.service.zapret2.memory_rss_mb : void 0,
|
||||
dnsmasqRunning: uiState.service.dnsmasq ? uiState.service.dnsmasq.running : void 0,
|
||||
dnsmasqMemoryMb: uiState.service.dnsmasq ? uiState.service.dnsmasq.memory_rss_mb : void 0,
|
||||
dnsmasqLocalCacheEnabled: uiState.service.dnsmasq ? uiState.service.dnsmasq.local_cache_enabled : void 0,
|
||||
dnsmasqCacheSize: uiState.service.dnsmasq ? uiState.service.dnsmasq.cache_size : void 0
|
||||
}
|
||||
},
|
||||
diagnosticsSystemInfo: normalizeSingBoxVariantFields(nextSystemInfo)
|
||||
@@ -7420,7 +7424,11 @@ async function fetchServicesInfo() {
|
||||
tachyonStatus: tachyon.success ? tachyon.data.status : previousData.tachyonStatus,
|
||||
watchdogRunning: watchdog.success ? Number(watchdog.data.running) : previousData.watchdogRunning,
|
||||
zapret2Running: previousData.zapret2Running,
|
||||
zapret2MemoryMb: previousData.zapret2MemoryMb
|
||||
zapret2MemoryMb: previousData.zapret2MemoryMb,
|
||||
dnsmasqRunning: previousData.dnsmasqRunning,
|
||||
dnsmasqMemoryMb: previousData.dnsmasqMemoryMb,
|
||||
dnsmasqLocalCacheEnabled: previousData.dnsmasqLocalCacheEnabled,
|
||||
dnsmasqCacheSize: previousData.dnsmasqCacheSize
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -9239,6 +9247,20 @@ async function renderServicesInfoWidget() {
|
||||
}
|
||||
});
|
||||
}
|
||||
if (data.dnsmasqRunning != null) {
|
||||
let cacheDetail = "";
|
||||
if (data.dnsmasqLocalCacheEnabled && data.dnsmasqCacheSize) {
|
||||
const approxMb = (data.dnsmasqCacheSize * 120 / (1024 * 1024)).toFixed(1);
|
||||
cacheDetail = ` [${_("Cache")}: ${data.dnsmasqCacheSize} ≈ ${approxMb} MB]`;
|
||||
}
|
||||
items.push({
|
||||
key: "Dnsmasq (DNS)",
|
||||
value: data.dnsmasqRunning ? data.dnsmasqMemoryMb ? `${_("✔ Running")} (${data.dnsmasqMemoryMb} MB)${cacheDetail}` : `${_("✔ Running")}${cacheDetail}` : _("✘ Stopped"),
|
||||
attributes: {
|
||||
class: data.dnsmasqRunning ? "tachyon_dashboard-page__widgets-section__item__row--success" : "tachyon_dashboard-page__widgets-section__item__row--error"
|
||||
}
|
||||
});
|
||||
}
|
||||
return items;
|
||||
},
|
||||
"renderServicesInfoWidget"
|
||||
|
||||
@@ -1869,14 +1869,75 @@ function createSettingsContent(section, capabilities) {
|
||||
"dns",
|
||||
form.Value,
|
||||
"dns_cache_size",
|
||||
_("DNS Cache Size"),
|
||||
_("Number of cached DNS domain entries in dnsmasq (default: 10000)."),
|
||||
_("DNS Cache Size (entries)"),
|
||||
_(
|
||||
"Maximum number of cached domain entries in dnsmasq (default: 10000 ≈ 1.2 MB RAM). Memory is allocated dynamically per request (~120 B per domain), not pre-allocated upfront. Recommended: 10000 for routers with ≥128 MB RAM, 2500–5000 for 64 MB devices.",
|
||||
),
|
||||
);
|
||||
o.depends("dns_local_cache", "1");
|
||||
o.default = "10000";
|
||||
o.datatype = "uinteger";
|
||||
o.placeholder = "10000";
|
||||
o.rmempty = true;
|
||||
|
||||
const originalDnsCacheRenderWidget = o.renderWidget;
|
||||
o.renderWidget = function (section_id, option_index, cfgvalue) {
|
||||
const node = originalDnsCacheRenderWidget.call(
|
||||
this,
|
||||
section_id,
|
||||
option_index,
|
||||
cfgvalue,
|
||||
);
|
||||
const input =
|
||||
node && typeof node.querySelector === "function"
|
||||
? node.querySelector("input")
|
||||
: node;
|
||||
|
||||
const calcNode = document.createElement("div");
|
||||
calcNode.className = "cbi-value-description";
|
||||
calcNode.style.marginTop = "4px";
|
||||
calcNode.style.fontSize = "12px";
|
||||
|
||||
const updateCalc = () => {
|
||||
const rawVal =
|
||||
input && input.value !== undefined && input.value !== ""
|
||||
? input.value
|
||||
: (cfgvalue || 10000);
|
||||
const val = parseInt(rawVal, 10);
|
||||
if (isNaN(val) || val <= 0) {
|
||||
calcNode.textContent =
|
||||
"⚡ " + _("Local DNS caching disabled (0 entries)");
|
||||
return;
|
||||
}
|
||||
const bytes = val * 120;
|
||||
const sizeText =
|
||||
bytes < 1024 * 1024
|
||||
? (bytes / 1024).toFixed(0) + " KB"
|
||||
: (bytes / (1024 * 1024)).toFixed(1) + " MB";
|
||||
|
||||
calcNode.innerHTML =
|
||||
"📊 " +
|
||||
_("Estimated RAM usage (max):") +
|
||||
" <strong>~" +
|
||||
sizeText +
|
||||
"</strong> " +
|
||||
"<span style='opacity: 0.8;'>(" +
|
||||
_("allocated dynamically on demand, not upfront") +
|
||||
")</span>";
|
||||
};
|
||||
|
||||
if (input && typeof input.addEventListener === "function") {
|
||||
input.addEventListener("input", updateCalc);
|
||||
input.addEventListener("change", updateCalc);
|
||||
}
|
||||
updateCalc();
|
||||
|
||||
if (node && typeof node.appendChild === "function") {
|
||||
node.appendChild(calcNode);
|
||||
}
|
||||
return node;
|
||||
};
|
||||
|
||||
// ─── DNS Strategy ────────────────────────────────────────────────────────
|
||||
|
||||
o = section.taboption(
|
||||
|
||||
@@ -7,8 +7,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: TACHYON\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-09-17 19:42+0300\n"
|
||||
"PO-Revision-Date: 2026-09-17 19:42+0300\n"
|
||||
"POT-Creation-Date: 2026-09-17 20:48+0300\n"
|
||||
"PO-Revision-Date: 2026-09-17 20:48+0300\n"
|
||||
"Last-Translator: Dushnilin\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: ru\n"
|
||||
@@ -425,6 +425,9 @@ msgstr "Все сервисы"
|
||||
msgid "All traffic from these IP addresses will be routed through the section unconditionally, ignoring all other conditions."
|
||||
msgstr "Весь трафик от этих IP-адресов будет маршрутизирован через секцию безусловно, игнорируя все остальные условия."
|
||||
|
||||
msgid "allocated dynamically on demand, not upfront"
|
||||
msgstr "выделяется динамически по мере запросов, а не сразу"
|
||||
|
||||
msgid "Allow / Enable ONLY in scheduled hours (White period)"
|
||||
msgstr "Разрешать / Включать ТОЛЬКО в указанные часы (Белый список)"
|
||||
|
||||
@@ -863,6 +866,9 @@ msgstr "Обходит UDP-трафик для выбранных игровых
|
||||
msgid "CA Certificate"
|
||||
msgstr "CA-сертификат"
|
||||
|
||||
msgid "Cache"
|
||||
msgstr ""
|
||||
|
||||
msgid "Cache all built-in lists and databases even if they are not currently selected in any section. Recommended if you have plenty of storage space or USB drive."
|
||||
msgstr "Кэшировать все встроенные списки и базы данных, даже если они не выбраны ни в одной секции. Рекомендуется при большом объёме хранилища или USB-накопителе."
|
||||
|
||||
@@ -1439,8 +1445,8 @@ msgstr "Автоподбор и бенчмарк DNS"
|
||||
msgid "DNS Blocking"
|
||||
msgstr "Блокировка DNS"
|
||||
|
||||
msgid "DNS Cache Size"
|
||||
msgstr "Размер кэша DNS"
|
||||
msgid "DNS Cache Size (entries)"
|
||||
msgstr "Размер DNS-кэша (записей)"
|
||||
|
||||
msgid "DNS Check Interval"
|
||||
msgstr "Интервал проверки DNS"
|
||||
@@ -1874,6 +1880,9 @@ msgstr "Ошибка выполнения трассировки:"
|
||||
msgid "Error updating lists:"
|
||||
msgstr "Ошибка обновления списков:"
|
||||
|
||||
msgid "Estimated RAM usage (max):"
|
||||
msgstr "Ориентировочный объём RAM (макс.):"
|
||||
|
||||
msgid "Every day"
|
||||
msgstr "Каждый день"
|
||||
|
||||
@@ -3104,6 +3113,9 @@ msgstr "Локальный адрес"
|
||||
msgid "Local DNS Cache"
|
||||
msgstr "Локальный кэш DNS"
|
||||
|
||||
msgid "Local DNS caching disabled (0 entries)"
|
||||
msgstr "Локальное DNS-кэширование отключено (0 записей)"
|
||||
|
||||
msgid "Local SOCKS proxy desynchronizer (ciadpi)"
|
||||
msgstr "Локальный десинхронизатор SOCKS-прокси (ciadpi)"
|
||||
|
||||
@@ -3176,6 +3188,9 @@ msgstr "Максимально допустимый суммарный траф
|
||||
msgid "Maximum allowed online time per guest device per day. When reached, access is blocked until midnight. Enter 0 for unlimited."
|
||||
msgstr "Максимально допустимое время доступа в интернет на одно гостевое устройство в день. При исчерпании доступ блокируется до полуночи. Введите 0 для отсутствия ограничений."
|
||||
|
||||
msgid "Maximum number of cached domain entries in dnsmasq (default: 10000 ≈ 1.2 MB RAM). Memory is allocated dynamically per request (~120 B per domain), not pre-allocated upfront. Recommended: 10000 for routers with ≥128 MB RAM, 2500–5000 for 64 MB devices."
|
||||
msgstr "Максимальный лимит кэшируемых доменов в dnsmasq (по умолчанию: 10000 ≈ 1.2 МБ RAM). Память выделяется динамически по мере запросов (~120 Б на домен), а не резервируется сразу. Рекомендуется: 10000 для роутеров от 128 МБ RAM, 2500–5000 для 64 МБ устройств."
|
||||
|
||||
msgid "Maximum size of junk packets"
|
||||
msgstr "Максимальный размер мусорных пакетов"
|
||||
|
||||
@@ -3479,9 +3494,6 @@ msgstr "Уведомлять о перезапусках сервиса"
|
||||
msgid "Notify on Subscription Updates"
|
||||
msgstr "Уведомлять об обновлениях подписок"
|
||||
|
||||
msgid "Number of cached DNS domain entries in dnsmasq (default: 10000)."
|
||||
msgstr "Количество кэшируемых доменных записей в dnsmasq (по умолчанию: 10000)."
|
||||
|
||||
msgid "Number of consecutive failed checks required before switching DNS servers."
|
||||
msgstr "Количество последовательных неудачных проверок до переключения DNS-серверов."
|
||||
|
||||
@@ -5990,6 +6002,12 @@ msgstr "Правила маршрутизации sing-box для Zapret2 не
|
||||
msgid "Zero config mesh VPN daemon"
|
||||
msgstr "Mesh VPN-демон с нулевой конфигурацией"
|
||||
|
||||
msgid "DNS Cache Size"
|
||||
msgstr "Размер кэша DNS"
|
||||
|
||||
msgid "Number of cached DNS domain entries in dnsmasq (default: 10000)."
|
||||
msgstr "Количество кэшируемых доменных записей в dnsmasq (по умолчанию: 10000)."
|
||||
|
||||
msgid "Add URLs or local paths to .srs / .json lists. Only domain rules are supported."
|
||||
msgstr "Добавьте URL или локальные пути к спискам .srs / .json. Поддерживаются только правила доменов."
|
||||
|
||||
|
||||
+1094
-1072
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user