Add diagnostics logging (RAM), UI viewer, and toggles

This commit is contained in:
Aaron
2025-12-13 11:16:57 -05:00
parent 28acb94a6f
commit 48be7a1c61
6 changed files with 386 additions and 9 deletions

View File

@@ -15,7 +15,7 @@ function shorten(text, max = 90) {
return text.length > max ? `${text.slice(0, max - 3)}...` : text;
}
export function initReleaseUI({ showToast, showBusy, hideBusy, confirmAction }) {
export function initReleaseUI({ showToast, showBusy, hideBusy, confirmAction, logUi = () => {} }) {
const releaseFlagTop = document.getElementById("releaseFlagTop");
const releaseBtn = document.getElementById("releaseBtn");
const releaseModal = document.getElementById("releaseModal");
@@ -236,6 +236,7 @@ export function initReleaseUI({ showToast, showBusy, hideBusy, confirmAction })
releaseCheckBtn?.addEventListener("click", async () => {
try {
logRelease("Checking for updates…");
logUi("Update check requested");
await checkRelease();
await loadReleaseStatus(true);
const state = window.__lastReleaseState || {};
@@ -254,6 +255,7 @@ export function initReleaseUI({ showToast, showBusy, hideBusy, confirmAction })
releaseApplyBtn?.addEventListener("click", async () => {
try {
lastReleaseToastKey = null;
logUi("Update apply requested");
const state = window.__lastReleaseState || {};
const { current_version, latest_version } = state;
const sameVersion =
@@ -287,6 +289,7 @@ export function initReleaseUI({ showToast, showBusy, hideBusy, confirmAction })
releaseRollbackBtn?.addEventListener("click", async () => {
try {
lastReleaseToastKey = null;
logUi("Rollback requested");
releaseBusyActive = true;
showBusy("Rolling back…", "Restoring previous backup.");
logRelease("Starting rollback…");