fix(webui): finish ?=…→/… URL migration in two missed nav spots
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=<id>` 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=<id>&from=setup` via window.navigateToRoute (absolute full-load fallback). - apps-manager getNavigationButton / handleNavigation: the "Install <Service>" buttons on config requirement fields used `app.html?app=<name>` 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/<name>` via navigateToRoute. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
parent
5532d6eee3
commit
42f2509193
@ -1914,10 +1914,10 @@ class AppsManager {
|
|||||||
// Get navigation button for installing required services
|
// Get navigation button for installing required services
|
||||||
getNavigationButton(fieldKey) {
|
getNavigationButton(fieldKey) {
|
||||||
const servicePages = {
|
const servicePages = {
|
||||||
'AUTHELIA': 'app.html?app=authelia',
|
'AUTHELIA': '/app/authelia',
|
||||||
'HEADSCALE': 'app.html?app=headscale',
|
'HEADSCALE': '/app/headscale',
|
||||||
'WHITELIST': 'app.html?app=traefik',
|
'WHITELIST': '/app/traefik',
|
||||||
'TRAEFIK': 'app.html?app=traefik'
|
'TRAEFIK': '/app/traefik'
|
||||||
};
|
};
|
||||||
|
|
||||||
let serviceName;
|
let serviceName;
|
||||||
@ -1947,8 +1947,14 @@ class AppsManager {
|
|||||||
|
|
||||||
// Handle navigation with unsaved changes check
|
// Handle navigation with unsaved changes check
|
||||||
handleNavigation(url, serviceName) {
|
handleNavigation(url, serviceName) {
|
||||||
// For now, just navigate - could add unsaved changes detection later
|
// SPA in-app nav (path-based routes), with an absolute-path full-load
|
||||||
window.location.href = url;
|
// 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
|
// Generate disabled field with navigation button
|
||||||
|
|||||||
@ -668,9 +668,12 @@ class SetupWizard {
|
|||||||
|
|
||||||
this.container.classList.add('setup-launched');
|
this.container.classList.add('setup-launched');
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const target = `tasks.html?task=${encodeURIComponent(firstTaskId)}&from=setup`;
|
// Path-based route (the app uses /… URLs); the specific task is still
|
||||||
if (window.router && typeof window.router.navigate === 'function') {
|
// selected via ?task=. Navigate via the SPA helper, with an absolute-path
|
||||||
window.router.navigate(target);
|
// full-load fallback.
|
||||||
|
const target = `/tasks/all?task=${encodeURIComponent(firstTaskId)}&from=setup`;
|
||||||
|
if (typeof window.navigateToRoute === 'function' && window.spaClean) {
|
||||||
|
window.navigateToRoute(target);
|
||||||
this.hide();
|
this.hide();
|
||||||
} else {
|
} else {
|
||||||
window.location.href = target;
|
window.location.href = target;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user