From b8956ebf7226728c61321eb6e9a5142e9d0f6736 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 5 Apr 2026 04:10:04 +0000 Subject: [PATCH] Move Update System button from header to sidebar Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/fb939db8-ba2c-4979-9b18-bebe2618d0b5 Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com> --- app/sovran_systemsos_web/static/js/events.js | 2 +- app/sovran_systemsos_web/static/js/state.js | 5 ++-- app/sovran_systemsos_web/static/js/tiles.js | 29 +++++++++++++++++-- app/sovran_systemsos_web/templates/index.html | 4 --- 4 files changed, 31 insertions(+), 9 deletions(-) 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