From 9c74a0d00fac8684576a11af072928f812a17305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=B8=D1=82=D0=B0=D0=BB=D0=B8=D0=B9=20=D0=9B=D0=B8?= =?UTF-8?q?=D1=82=D0=B2=D0=B8=D0=BD=D0=BE=D0=B2?= Date: Fri, 24 Apr 2026 22:44:47 +0300 Subject: [PATCH] v2.5.0: guard web admin log loading race --- admin-web/static/app.js | 9 ++++++++- admin-web/static/index.html | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/admin-web/static/app.js b/admin-web/static/app.js index 29ef6d1..9166ee3 100644 --- a/admin-web/static/app.js +++ b/admin-web/static/app.js @@ -658,11 +658,18 @@ async function createBackup() { async function loadLogs() { const service = $("#logService").value; + const btn = $("#loadLogsBtn"); + btn.disabled = true; $("#logsBox").textContent = t("loading"); try { - $("#logsBox").textContent = await api(`/api/logs?service=${encodeURIComponent(service)}`); + const logs = await api(`/api/logs?service=${encodeURIComponent(service)}`); + if ($("#logService").value === service) { + $("#logsBox").textContent = logs; + } } catch (err) { $("#logsBox").textContent = err.message; + } finally { + btn.disabled = false; } } diff --git a/admin-web/static/index.html b/admin-web/static/index.html index f348642..e274c4e 100644 --- a/admin-web/static/index.html +++ b/admin-web/static/index.html @@ -11,7 +11,7 @@ document.documentElement.dataset.theme = theme; }()); - +
@@ -264,6 +264,6 @@
- +