mirror of
https://github.com/andrey271192/amnezia_web.git
synced 2026-09-20 14:41:59 +00:00
fix(mtproto): harden panel + deploy visibility
- Rename snapshot to snap; bust app.js cache (?v).\n- /health returns version from package.json; startup log prints v. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -366,39 +366,42 @@ async function refreshMtprotoPanel() {
|
||||
mtprotoBanner.textContent = "";
|
||||
}
|
||||
try {
|
||||
const s = await api("/api/mtproto/status");
|
||||
if (mtprotoLogsTailEl) mtprotoLogsTailEl.textContent = typeof s.logsTail === "string" ? s.logsTail : "";
|
||||
const snap = await api("/api/mtproto/status");
|
||||
if (mtprotoLogsTailEl) {
|
||||
mtprotoLogsTailEl.textContent =
|
||||
typeof snap.logsTail === "string" ? snap.logsTail : "";
|
||||
}
|
||||
|
||||
const parts = [];
|
||||
if (s.exists) parts.push("контейнер есть");
|
||||
if (s.running) parts.push("запущен");
|
||||
if (snap.exists) parts.push("контейнер есть");
|
||||
if (snap.running) parts.push("запущен");
|
||||
mtprotoStatusLine.textContent =
|
||||
parts.length > 0
|
||||
? parts.join(" · ") +
|
||||
(s.hostPort ? ` · порт хоста :${String(s.hostPort)}` : "") +
|
||||
(s.secretMasked ? ` · секрет ${s.secretMasked}` : "")
|
||||
(snap.hostPort ? ` · порт хоста :${String(snap.hostPort)}` : "") +
|
||||
(snap.secretMasked ? ` · секрет ${snap.secretMasked}` : "")
|
||||
: "не установлен";
|
||||
|
||||
if (typeof s.hint === "string" && s.hint.trim()) {
|
||||
if (typeof snap.hint === "string" && snap.hint.trim()) {
|
||||
const hintEl = document.createElement("p");
|
||||
hintEl.className = "muted warp-muted";
|
||||
hintEl.textContent = s.hint.trim();
|
||||
hintEl.textContent = snap.hint.trim();
|
||||
mtprotoActionsEl.appendChild(hintEl);
|
||||
} else if (s.exists && !s.running && typeof s.image === "string" && s.image.trim()) {
|
||||
} else if (snap.exists && !snap.running && typeof snap.image === "string" && snap.image.trim()) {
|
||||
const imgHint = document.createElement("p");
|
||||
imgHint.className = "muted warp-muted";
|
||||
imgHint.textContent = `После установки образ будет доступен здесь (${s.image.trim()} при актуальной конфигурации).`;
|
||||
imgHint.textContent = `После установки образ будет доступен здесь (${snap.image.trim()} при актуальной конфигурации).`;
|
||||
mtprotoActionsEl.appendChild(imgHint);
|
||||
}
|
||||
|
||||
if (s.tgLink) {
|
||||
if (snap.tgLink) {
|
||||
const link = document.createElement("div");
|
||||
link.className = "mtproto-deep-link muted warp-muted";
|
||||
const lab = document.createElement("strong");
|
||||
lab.textContent = "Ссылка в Telegram: ";
|
||||
const a = document.createElement("a");
|
||||
a.href = s.tgLink;
|
||||
a.textContent = s.tgLink;
|
||||
a.href = snap.tgLink;
|
||||
a.textContent = snap.tgLink;
|
||||
a.target = "_blank";
|
||||
a.rel = "noopener noreferrer";
|
||||
link.append(lab, a);
|
||||
|
||||
@@ -261,6 +261,6 @@
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
<script src="/app.js" type="module"></script>
|
||||
<script src="/app.js?v=1.2.18" type="module"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user