From 0dcf66cb5bbcfe3d36fd28b9ac70d5778a1aef56 Mon Sep 17 00:00:00 2001 From: Saithej2k Date: Sat, 27 Jun 2026 18:16:30 -0400 Subject: [PATCH] fix: reload dashboard under http node root --- ui/src/main.mjs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ui/src/main.mjs b/ui/src/main.mjs index 008d23112..56e7c0925 100644 --- a/ui/src/main.mjs +++ b/ui/src/main.mjs @@ -85,13 +85,21 @@ const vuetify = createVuetify({ const host = new URL(window.location.href) +function getDashboardReloadUrl () { + const setupBasePath = store.state.setup.setup?.basePath + const currentDashboardPath = window.location.pathname.match(/^(.+?\/dashboard)(?:\/|$)/)?.[1] + const basePath = setupBasePath || currentDashboardPath || '/dashboard' + + return new URL(basePath, window.location.origin) +} + function forcePageReload (err) { console.log('Reloading page:', err) - console.log('redirecting to:', window.location.origin + '/dashboard') // Reloading dashboard without using cache by appending a cache-busting string to fully reload page to allow redirecting to auth const currentParams = new URLSearchParams(window.location.search) - const url = new URL(window.location.origin + '/dashboard') + const url = getDashboardReloadUrl() + console.log('redirecting to:', url.toString()) currentParams.set('reloadTime', Date.now().toString() + Math.random()) if (host.searchParams.has('edit-key')) { currentParams.set('edit-key', host.searchParams.get('edit-key'))