fix: remote dashboard redirect loop on Cloudflare Pages#15
Open
falkoro wants to merge 3 commits into
Open
Conversation
Remove reliance on _redirects (caused infinite / <-> /index.html loop and browser cookie errors). Demo mode now auto-enables when no ?api= is set.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the static “remote” dashboard to behave better when hosted on Cloudflare Pages (no upstream API configured), while also adding some visual polish to the UI.
Changes:
- Adds an auto-enabled demo mode (with
?demo=0override) that renders sample usage data when no?api=is provided. - Adjusts runtime behavior so demo mode doesn’t schedule periodic upstream refreshes.
- Introduces new UI effects (header canvas animation, progress shimmer, and “danger” card glow behavior).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
571
to
575
| function upstreamLabel() { | ||
| if (DEMO_MODE) return 'demo preview'; | ||
| if (API_BASE) { | ||
| try { | ||
| return new URL(API_BASE, location.href).host; |
Comment on lines
+681
to
+691
| tick += 0.016; | ||
| raf = requestAnimationFrame(draw); | ||
| } | ||
|
|
||
| resize(); | ||
| draw(); | ||
| window.addEventListener('resize', resize); | ||
| document.addEventListener('visibilitychange', () => { | ||
| if (document.hidden) cancelAnimationFrame(raf); | ||
| else draw(); | ||
| }); |
…setup - Add local/remote/mixed machine source settings with remote usage fetch - Fix remote dashboard redirect loop via normalized usage URL builder - Add pinned overlay bar and subtle panel/nav UI refresh - Let users save a MiniMax API key from the provider detail page
51d8b65 to
4b36824
Compare
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.
Problem
The Cloudflare
_redirectsrule (/ /index.html?demo=1 200) fought Pages' canonical URL normalization, causing an infinite/↔/index.htmlredirect loop. Browsers often surface that as a cookies / redirect error.Fix
_redirectsfrom deploys?api=is set (static Pages hosting)?demo=0to disable demo if neededLive
https://tokenmaxxing-remote.pages.dev/ (HTTP 200, demo animations work)