From 42f250919349cf9989a959e78c610aa3fa6f29d1 Mon Sep 17 00:00:00 2001 From: librelad Date: Sun, 24 May 2026 22:29:03 +0100 Subject: [PATCH] =?UTF-8?q?fix(webui):=20finish=20=3F=3D=E2=80=A6=E2=86=92?= =?UTF-8?q?/=E2=80=A6=20URL=20migration=20in=20two=20missed=20nav=20spots?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both used the pre-migration query/.html URL form through navigation that no longer exists, so they landed on a not-found / wrong page: - setup-wizard handoffToTasks: navigated to `tasks.html?task=` via the never-defined window.router, falling back to a *relative* window.location.href. From any non-root path that resolves under the current path (e.g. /admin/config/tasks.html → matches the /admin* route), so the first-install "x of x installing" hand-off hit a not-found task page. Now navigates to the path-based `/tasks/all?task=&from=setup` via window.navigateToRoute (absolute full-load fallback). - apps-manager getNavigationButton / handleNavigation: the "Install " buttons on config requirement fields used `app.html?app=` with a relative window.location.href; from the /admin/config/* pages they render on, that resolved to /admin/config/app.html (wrong route). Now `/app/` via navigateToRoute. Co-Authored-By: Claude Opus 4.7 Signed-off-by: librelad --- .../frontend/js/components/app/apps-manager.js | 18 ++++++++++++------ .../frontend/js/system/setup-wizard.js | 9 ++++++--- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/containers/libreportal/frontend/js/components/app/apps-manager.js b/containers/libreportal/frontend/js/components/app/apps-manager.js index 7c66b62..8b9a688 100755 --- a/containers/libreportal/frontend/js/components/app/apps-manager.js +++ b/containers/libreportal/frontend/js/components/app/apps-manager.js @@ -1914,10 +1914,10 @@ class AppsManager { // Get navigation button for installing required services getNavigationButton(fieldKey) { const servicePages = { - 'AUTHELIA': 'app.html?app=authelia', - 'HEADSCALE': 'app.html?app=headscale', - 'WHITELIST': 'app.html?app=traefik', - 'TRAEFIK': 'app.html?app=traefik' + 'AUTHELIA': '/app/authelia', + 'HEADSCALE': '/app/headscale', + 'WHITELIST': '/app/traefik', + 'TRAEFIK': '/app/traefik' }; let serviceName; @@ -1947,8 +1947,14 @@ class AppsManager { // Handle navigation with unsaved changes check handleNavigation(url, serviceName) { - // For now, just navigate - could add unsaved changes detection later - window.location.href = url; + // SPA in-app nav (path-based routes), with an absolute-path full-load + // fallback. A relative window.location.href here resolved wrong from the + // /admin/config/* pages these buttons render on. + if (typeof window.navigateToRoute === 'function' && window.spaClean) { + window.navigateToRoute(url); + } else { + window.location.href = url; + } } // Generate disabled field with navigation button diff --git a/containers/libreportal/frontend/js/system/setup-wizard.js b/containers/libreportal/frontend/js/system/setup-wizard.js index 43150ff..ba59ad2 100755 --- a/containers/libreportal/frontend/js/system/setup-wizard.js +++ b/containers/libreportal/frontend/js/system/setup-wizard.js @@ -668,9 +668,12 @@ class SetupWizard { this.container.classList.add('setup-launched'); setTimeout(() => { - const target = `tasks.html?task=${encodeURIComponent(firstTaskId)}&from=setup`; - if (window.router && typeof window.router.navigate === 'function') { - window.router.navigate(target); + // Path-based route (the app uses /… URLs); the specific task is still + // selected via ?task=. Navigate via the SPA helper, with an absolute-path + // full-load fallback. + const target = `/tasks/all?task=${encodeURIComponent(firstTaskId)}&from=setup`; + if (typeof window.navigateToRoute === 'function' && window.spaClean) { + window.navigateToRoute(target); this.hide(); } else { window.location.href = target;