diff --git a/app/sovran_systemsos_web/static/js/events.js b/app/sovran_systemsos_web/static/js/events.js index 2f4733b..8d5e9ea 100644 --- a/app/sovran_systemsos_web/static/js/events.js +++ b/app/sovran_systemsos_web/static/js/events.js @@ -2,7 +2,7 @@ // ── Event listeners ─────────────────────────────────────────────── -if ($updateBtn) $updateBtn.addEventListener("click", openUpdateModal); +// if ($updateBtn) $updateBtn.addEventListener("click", openUpdateModal); // moved to sidebar in tiles.js if ($btnCloseModal) $btnCloseModal.addEventListener("click", closeUpdateModal); if ($btnReboot) $btnReboot.addEventListener("click", doReboot); if ($btnSave) $btnSave.addEventListener("click", saveErrorReport); diff --git a/app/sovran_systemsos_web/static/js/state.js b/app/sovran_systemsos_web/static/js/state.js index ed4d588..896c372 100644 --- a/app/sovran_systemsos_web/static/js/state.js +++ b/app/sovran_systemsos_web/static/js/state.js @@ -34,8 +34,9 @@ let _rebuildIsEnabling = true; const $tilesArea = document.getElementById("tiles-area"); const $sidebarSupport = document.getElementById("sidebar-support"); const $sidebarFeatures = document.getElementById("sidebar-features"); -const $updateBtn = document.getElementById("btn-update"); -const $updateBadge = document.getElementById("update-badge"); +// No longer needed — Update System moved to sidebar +// const $updateBtn = document.getElementById("btn-update"); +// const $updateBadge = document.getElementById("update-badge"); const $internalIp = document.getElementById("ip-internal"); const $externalIp = document.getElementById("ip-external"); diff --git a/app/sovran_systemsos_web/static/js/tiles.js b/app/sovran_systemsos_web/static/js/tiles.js index 1574182..aac3e28 100644 --- a/app/sovran_systemsos_web/static/js/tiles.js +++ b/app/sovran_systemsos_web/static/js/tiles.js @@ -45,6 +45,20 @@ function buildTiles(services, categoryLabels) { function renderSidebarSupport(supportServices) { $sidebarSupport.innerHTML = ""; + + // ── Update System button (above Tech Help) + var sidebarUpdateBtn = document.createElement("button"); + sidebarUpdateBtn.className = "sidebar-support-btn"; + sidebarUpdateBtn.id = "sidebar-btn-update"; + sidebarUpdateBtn.innerHTML = + '' + + ''; + sidebarUpdateBtn.addEventListener("click", function() { openUpdateModal(); }); + $sidebarSupport.appendChild(sidebarUpdateBtn); + for (var i = 0; i < supportServices.length; i++) { var svc = supportServices[i]; var btn = document.createElement("button"); @@ -170,7 +184,18 @@ async function checkUpdates() { try { var data = await apiFetch("/api/updates/check"); var hasUpdates = !!data.available; - if ($updateBadge) $updateBadge.classList.toggle("visible", hasUpdates); - if ($updateBtn) $updateBtn.classList.toggle("has-updates", hasUpdates); + var sidebarUpdateBtn = document.getElementById("sidebar-btn-update"); + var sidebarUpdateHint = document.getElementById("sidebar-update-hint"); + if (sidebarUpdateBtn) { + if (hasUpdates) { + sidebarUpdateBtn.style.borderColor = "#2ec27e"; + sidebarUpdateBtn.style.backgroundColor = "rgba(46, 194, 126, 0.08)"; + if (sidebarUpdateHint) sidebarUpdateHint.textContent = "Updates available!"; + } else { + sidebarUpdateBtn.style.borderColor = ""; + sidebarUpdateBtn.style.backgroundColor = ""; + if (sidebarUpdateHint) sidebarUpdateHint.textContent = "System is up to date"; + } + } } catch (_) {} } diff --git a/app/sovran_systemsos_web/templates/index.html b/app/sovran_systemsos_web/templates/index.html index 9f9b37c..ea904cb 100644 --- a/app/sovran_systemsos_web/templates/index.html +++ b/app/sovran_systemsos_web/templates/index.html @@ -23,10 +23,6 @@ Sovran_SystemsOS Hub