From b5107e30cc544908268ff55df05e13c4087f83ea Mon Sep 17 00:00:00 2001 From: librelad Date: Sat, 23 May 2026 17:57:21 +0100 Subject: [PATCH] feat(admin): Admin Overview landing + unified Admin page headers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add an Admin Overview as the Admin landing (default when you open Admin): an ops/health board distinct from the user Dashboard. Four cards built from data we already generate — Updates (update_status.json, with one-click update), Backups (backup dashboard.json), SSH & Security (access.json), System (disk/memory/system_info) — each with a Manage link into the right section. Styled like the backup dashboard (tiles/status dots). Wire-up: 'Overview' is the top sidebar item and the default category (handleConfig + sidebar), rendered by AdminOverview into #config-section via a renderConfig('overview') special case. Every Admin page now shows the same 'Admin' breadcrumb header (Overview, SSH Access, and the config categories) for a consistent Admin → Section feel. User Dashboard gets an 'Admin overview →' link. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- containers/libreportal/frontend/css/admin.css | 100 ++++++++++ .../frontend/html/dashboard-content.html | 5 + containers/libreportal/frontend/index.html | 2 + .../js/components/admin/admin-overview.js | 185 ++++++++++++++++++ .../js/components/config/config-manager.js | 13 ++ .../js/components/config/config-sidebar.js | 20 +- .../frontend/js/components/ssh/ssh-page.js | 9 +- containers/libreportal/frontend/js/spa.js | 8 +- 8 files changed, 333 insertions(+), 9 deletions(-) create mode 100644 containers/libreportal/frontend/css/admin.css create mode 100644 containers/libreportal/frontend/js/components/admin/admin-overview.js diff --git a/containers/libreportal/frontend/css/admin.css b/containers/libreportal/frontend/css/admin.css new file mode 100644 index 0000000..2d0c68e --- /dev/null +++ b/containers/libreportal/frontend/css/admin.css @@ -0,0 +1,100 @@ +/* Admin area — Overview board + shared admin-page chrome. Visually aligned + with the backup dashboard (tile/card style) and the config page header. */ + +.admin-page { + padding: 4px 2px 40px; +} + +.admin-breadcrumb { + font-size: 0.72rem; + font-weight: 700; + letter-spacing: 0.06em; + text-transform: uppercase; + color: rgba(var(--text-rgb), 0.45); + margin-bottom: 2px; +} + +/* Overview cards */ +.admin-card-grid { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + gap: 16px; + margin-top: 8px; +} + +.admin-card { + display: flex; + flex-direction: column; + padding: 16px; + border: 1px solid rgba(var(--text-rgb), 0.10); + border-radius: 12px; + background: var(--card-bg); +} + +.admin-card-head { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 12px; +} + +.admin-card-title { + font-size: 0.95rem; + font-weight: 700; +} + +.admin-status-dot { + width: 10px; + height: 10px; + border-radius: 50%; + flex-shrink: 0; +} +.admin-status-dot.ok { background: #36d399; } +.admin-status-dot.warn { background: #fbbd23; } +.admin-status-dot.none { background: rgba(var(--text-rgb), 0.25); } + +.admin-card-body { + display: flex; + flex-direction: column; + gap: 6px; + flex: 1; +} + +.admin-card-line { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: 12px; + font-size: 0.85rem; + color: rgba(var(--text-rgb), 0.6); +} +.admin-card-line strong { + color: var(--text-primary); + font-weight: 600; + text-align: right; + word-break: break-word; +} + +.admin-card-actions { + margin-top: 14px; + padding-top: 12px; + border-top: 1px solid rgba(var(--text-rgb), 0.08); +} + +.admin-card-ok { + font-size: 0.82rem; + color: rgba(var(--text-rgb), 0.55); +} + +/* Small entry point on the user Dashboard that links into the Admin area. */ +.dashboard-admin-link { + display: inline-flex; + align-items: center; + gap: 6px; + margin: 4px 0 0; + font-size: 0.85rem; + font-weight: 600; + color: var(--accent); + text-decoration: none; +} +.dashboard-admin-link:hover { text-decoration: underline; } diff --git a/containers/libreportal/frontend/html/dashboard-content.html b/containers/libreportal/frontend/html/dashboard-content.html index 5501f81..5027fb3 100755 --- a/containers/libreportal/frontend/html/dashboard-content.html +++ b/containers/libreportal/frontend/html/dashboard-content.html @@ -46,6 +46,11 @@ + + Admin overview + + +