From 350dc5623a457bc48574bd1952c6afabed1eea2c Mon Sep 17 00:00:00 2001 From: librelad Date: Thu, 28 May 2026 23:40:31 +0100 Subject: [PATCH] ux(admin): add a leading icon to each Overview card action button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update/Verify (refresh, shield-check), Manage backups (archive), Manage SSH (key), View system stats (activity). Icons inherit the button's text colour — no per-button colour, so the footer stays calm; the icon plus the card's status dot do the distinguishing. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- .../js/components/admin/admin-overview.js | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/containers/libreportal/frontend/js/components/admin/admin-overview.js b/containers/libreportal/frontend/js/components/admin/admin-overview.js index f7e5592..7ceb40f 100644 --- a/containers/libreportal/frontend/js/components/admin/admin-overview.js +++ b/containers/libreportal/frontend/js/components/admin/admin-overview.js @@ -139,6 +139,20 @@ class AdminOverview { return `
${this.escape(label)}${this.escape(value)}
`; } + // Small inline icon for a card action button. Inherits the button's text + // colour (no per-button colour) — the icon + the card's status dot do the + // distinguishing, so the footer stays calm. + icon(name) { + const paths = { + update: '', + verify: '', + backup: '', + ssh: '', + system: '', + }; + return ``; + } + render() { const root = this.root(); if (!root) return; @@ -157,8 +171,8 @@ class AdminOverview { // Update now takes priority when one's available; otherwise offer Verify now. const updActions = (updAvail && upd.can_update) - ? `` - : ``; + ? `` + : ``; const updCard = this.card( 'Updates', @@ -180,7 +194,7 @@ class AdminOverview { this.line('Apps protected', `${protectedApps} / ${apps.length}`) + this.line('Locations', String(locs.length)) + this.line('Stored', this.bytes(totalSize)), - `` + `` ); // SSH & Security @@ -195,7 +209,7 @@ class AdminOverview { this.line('Password login', pwOn ? 'On' : 'Key-only') + this.line('Authorized keys', String(keyCount)) + this.line('Login user', s.user || '—'), - `` + `` ); // System health @@ -212,7 +226,7 @@ class AdminOverview { ? `${this.gb(mem.used)} / ${this.gb(mem.total)} (${Math.round(mem.percent) || 0}%)` : (mem.text || '—')) + this.line('Uptime', this.shortUptime(info.uptime)), - `` + `` ); root.innerHTML = `