Conversation
Add Metrics Tab to Settings Page for Admins
Configurable instances managed from Settings (AstroBin & NINA tab). Backend proxies requests to NINA framing API and Stellarium remote control. Stellarium uses name-first lookup with RA/Dec fallback.
Stellarium returns 200 with body "false" when name lookup fails. Now checks the response text instead of just HTTP status. Also extracts the catalog designation (e.g. NGC 1499) from compound names like "NGC 1499 - California Nebula" and tries that first.
onServerReady() called refreshUser() without a timeout, so if the backend was slow to respond after the health check passed the app stayed on "Loading..." forever. Added a 5-second timeout matching initAuth(). Also suppress the hard window.location redirect during auth initialization to avoid racing with the SolidJS router.
Replace refreshUser()/fetchJson in initAuth and onServerReady with a direct probeAuth() that uses raw fetch calls. This avoids the shared refreshPromise, the window.location hard redirect, and any interaction with the parallel settings/custom-columns resource fetches that also go through fetchJson's 401 handler. Reverts the suppressAuthRedirect flag from client.ts since it is no longer needed.
fetchJson's 401 handler was firing window.location.href = "/login" which caused a full page reload that disrupted the SolidJS app during initialization. Replace with a CustomEvent that AuthProvider listens to, clearing the user signal so ProtectedRoute handles the redirect via client-side navigation instead.
onServerReady now just calls initAuth() instead of duplicating the probeAuth logic. If the server isn't actually ready yet, initAuth will cycle back to the startup screen. Added a 15-second failsafe timer that forces loading=false if auth never completes, preventing the app from staying stuck on "Loading..." indefinitely.
Add Cache-Control: no-store to index.html so the browser always fetches a fresh copy after rebuilds, preventing stale JS bundles. Gate the settings and custom-columns resources on auth state so they only fire after the user is authenticated. Previously the module-level createResource in settings.ts fired at import time before auth resolved, hitting 502 during startup and throwing unhandled errors that could break the SolidJS reactive system.
Auth Flow Refinements, Startup Fixes, and Integrations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves several authentication and startup loading issues, refines various user interface elements, and introduces a new Metrics tab for admin users.
Changes
onServerReadyto reuseinitAuthand add a 15-second failsafe.window.locationredirects with anauth:expiredevent.fetchJsonfor initial authentication.Impact