v2.5.0: guard web admin log loading race

This commit is contained in:
Виталий Литвинов
2026-04-24 22:44:47 +03:00
parent 3ab0f9d5c7
commit 9c74a0d00f
2 changed files with 10 additions and 3 deletions

View File

@@ -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;
}
}