From ba3f71cf7a2f87250eb39165ebf6edd1397c2713 Mon Sep 17 00:00:00 2001 From: librelad Date: Thu, 28 May 2026 23:41:30 +0100 Subject: [PATCH] refactor(routing): admin overview canonical URL is /admin/dashboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The admin ops/health board now lives at /admin/dashboard (adminPath ('overview') emits it; the topbar Admin link points there). Bare /admin still resolves to the same board — no redirect, both paths render it. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- containers/libreportal/frontend/html/topbar.html | 2 +- containers/libreportal/frontend/js/spa.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/containers/libreportal/frontend/html/topbar.html b/containers/libreportal/frontend/html/topbar.html index 4911e0b..e0f06e8 100755 --- a/containers/libreportal/frontend/html/topbar.html +++ b/containers/libreportal/frontend/html/topbar.html @@ -45,7 +45,7 @@ App Center - + diff --git a/containers/libreportal/frontend/js/spa.js b/containers/libreportal/frontend/js/spa.js index 44f83c3..97f81c1 100755 --- a/containers/libreportal/frontend/js/spa.js +++ b/containers/libreportal/frontend/js/spa.js @@ -550,7 +550,7 @@ class LibrePortalSPAClean { // Admin area path helpers (shared by the SPA, sidebar, overview, ssh page). // Map a category to its path-based URL, and parse a path back to a category. window.adminPath = function (category) { - if (!category || category === 'overview') return '/admin'; + if (!category || category === 'overview') return '/admin/dashboard'; // the admin board if (category === 'system') return '/admin/system'; // stats, not config if (category === 'ssh-access') return '/admin/tools/ssh-access'; if (category === 'peers') return '/admin/tools/peers'; @@ -558,7 +558,8 @@ window.adminPath = function (category) { }; window.adminCategoryFromPath = function (pathname) { const segs = String(pathname || '').replace(/^\/admin\/?/, '').split('/').filter(Boolean); - if (!segs.length || segs[0] === 'overview') return 'overview'; + // Bare /admin and /admin/dashboard both resolve to the overview board. + if (!segs.length || segs[0] === 'overview' || segs[0] === 'dashboard') return 'overview'; if (segs[0] === 'config') return segs[1] || 'general'; if (segs[0] === 'tools') return segs[1] || 'overview'; return segs[0];