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>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-05 04:10:04 +00:00
committed by GitHub
parent 4bda2f1aae
commit b8956ebf72
4 changed files with 31 additions and 9 deletions

View File

@@ -2,7 +2,7 @@
// ── Event listeners ─────────────────────────────────────────────── // ── 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 ($btnCloseModal) $btnCloseModal.addEventListener("click", closeUpdateModal);
if ($btnReboot) $btnReboot.addEventListener("click", doReboot); if ($btnReboot) $btnReboot.addEventListener("click", doReboot);
if ($btnSave) $btnSave.addEventListener("click", saveErrorReport); if ($btnSave) $btnSave.addEventListener("click", saveErrorReport);

View File

@@ -34,8 +34,9 @@ let _rebuildIsEnabling = true;
const $tilesArea = document.getElementById("tiles-area"); const $tilesArea = document.getElementById("tiles-area");
const $sidebarSupport = document.getElementById("sidebar-support"); const $sidebarSupport = document.getElementById("sidebar-support");
const $sidebarFeatures = document.getElementById("sidebar-features"); const $sidebarFeatures = document.getElementById("sidebar-features");
const $updateBtn = document.getElementById("btn-update"); // No longer needed — Update System moved to sidebar
const $updateBadge = document.getElementById("update-badge"); // const $updateBtn = document.getElementById("btn-update");
// const $updateBadge = document.getElementById("update-badge");
const $internalIp = document.getElementById("ip-internal"); const $internalIp = document.getElementById("ip-internal");
const $externalIp = document.getElementById("ip-external"); const $externalIp = document.getElementById("ip-external");

View File

@@ -45,6 +45,20 @@ function buildTiles(services, categoryLabels) {
function renderSidebarSupport(supportServices) { function renderSidebarSupport(supportServices) {
$sidebarSupport.innerHTML = ""; $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 =
'<span class="sidebar-support-icon">🔄</span>' +
'<span class="sidebar-support-text">' +
'<span class="sidebar-support-title">Update System</span>' +
'<span class="sidebar-support-hint" id="sidebar-update-hint">Check for updates</span>' +
'</span>';
sidebarUpdateBtn.addEventListener("click", function() { openUpdateModal(); });
$sidebarSupport.appendChild(sidebarUpdateBtn);
for (var i = 0; i < supportServices.length; i++) { for (var i = 0; i < supportServices.length; i++) {
var svc = supportServices[i]; var svc = supportServices[i];
var btn = document.createElement("button"); var btn = document.createElement("button");
@@ -170,7 +184,18 @@ async function checkUpdates() {
try { try {
var data = await apiFetch("/api/updates/check"); var data = await apiFetch("/api/updates/check");
var hasUpdates = !!data.available; var hasUpdates = !!data.available;
if ($updateBadge) $updateBadge.classList.toggle("visible", hasUpdates); var sidebarUpdateBtn = document.getElementById("sidebar-btn-update");
if ($updateBtn) $updateBtn.classList.toggle("has-updates", hasUpdates); 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 (_) {} } catch (_) {}
} }

View File

@@ -23,10 +23,6 @@
<span class="title">Sovran_SystemsOS Hub</span> <span class="title">Sovran_SystemsOS Hub</span>
<div class="header-buttons"> <div class="header-buttons">
<span class="role-badge" id="role-badge">Loading…</span> <span class="role-badge" id="role-badge">Loading…</span>
<button class="btn btn-update" id="btn-update" title="Run system update">
<span class="update-badge" id="update-badge"></span>
Update System
</button>
</div> </div>
</header> </header>