From 8d6bf1a45cb88f9c1fbbfe175e3cd804f8f7f91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=91=D0=BE=D0=B1?= =?UTF-8?q?=D1=8B=D1=80=D0=B5=D0=B2?= Date: Fri, 15 May 2026 03:55:10 +0300 Subject: [PATCH] feat(ui): light theme + mtproto host-port explainer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Default palette is light for readability; fix orphaned .edition-banner CSS. Explain Docker 443→host map in mtproto panel. Cache-bust css/js v1.2.19. Co-authored-by: Cursor --- package.json | 2 +- public/app.js | 23 ++++++++ public/index.html | 5 +- public/styles.css | 144 +++++++++++++++++++++++++++++----------------- 4 files changed, 119 insertions(+), 55 deletions(-) diff --git a/package.json b/package.json index 8f980cb..97df75b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "amnezia-admin", - "version": "1.2.18", + "version": "1.2.19", "private": true, "description": "amnezia_web — базовая панель AmneziaWG (FREE: просмотр и удаление клиентов; полная версия — PRO).", "license": "MIT", diff --git a/public/app.js b/public/app.js index b3272e4..71985ff 100644 --- a/public/app.js +++ b/public/app.js @@ -28,6 +28,7 @@ const mtprotoLogsTailEl = document.querySelector("#mtproto-logs-tail"); const mtprotoBanner = document.querySelector("#mtproto-banner"); const mtprotoHostPortInput = document.querySelector("#mtproto-host-port"); const mtprotoSecretInput = document.querySelector("#mtproto-secret-opt"); +const mtprotoCalloutEl = document.querySelector("#mtproto-callout"); const cascadePanel = document.querySelector("#cascade-panel"); const usersPanel = document.querySelector("#users-panel"); @@ -357,6 +358,10 @@ async function refreshMtprotoPanel() { if (!mtprotoPanel || !mtprotoStatusLine || !mtprotoActionsEl) return; if (uiHidden.mtproto) { mtprotoPanel.hidden = true; + if (mtprotoCalloutEl) { + mtprotoCalloutEl.textContent = ""; + mtprotoCalloutEl.classList.add("hidden"); + } return; } mtprotoPanel.hidden = false; @@ -372,6 +377,20 @@ async function refreshMtprotoPanel() { typeof snap.logsTail === "string" ? snap.logsTail : ""; } + if (mtprotoCalloutEl) { + if (snap.exists) { + const hp = + snap.hostPort != null && snap.hostPort !== "" ? String(snap.hostPort) : null; + mtprotoCalloutEl.classList.remove("hidden"); + mtprotoCalloutEl.textContent = hp + ? `Официальный образ слушает 443/tcp внутри контейнера — это норма. На хост проброшен порт ${hp}: в Telegram указывайте публичный IP/DNS этого VPS и порт ${hp}. В логах ниже официальный прокси сам пишет tg:// и port=443 (внутренний процесс); при таком пробросе в клиенте используйте порт ${hp}, а не 443. Ссылку из синего блока панели (если показана) можно открыть как есть.` + : `Официальный образ слушает 443/tcp внутри контейнера; снаружи — порт хоста из строки статуса («порт хоста»). Если в логах видно tg:// с port=443, для подключения с интернета подставляйте порт хоста из статуса, не 443.`; + } else { + mtprotoCalloutEl.textContent = ""; + mtprotoCalloutEl.classList.add("hidden"); + } + } + const parts = []; if (snap.exists) parts.push("контейнер есть"); if (snap.running) parts.push("запущен"); @@ -484,6 +503,10 @@ async function refreshMtprotoPanel() { mtprotoActionsEl.appendChild(row); } catch (e) { + if (mtprotoCalloutEl) { + mtprotoCalloutEl.textContent = ""; + mtprotoCalloutEl.classList.add("hidden"); + } if (mtprotoLogsTailEl) mtprotoLogsTailEl.textContent = ""; const err = document.createElement("p"); err.className = "muted warp-muted err"; diff --git a/public/index.html b/public/index.html index f99e092..292d14a 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,7 @@ - +