Skip to content

fix: remote dashboard redirect loop on Cloudflare Pages#15

Open
falkoro wants to merge 3 commits into
masterfrom
fix/remote-dashboard-redirect-loop
Open

fix: remote dashboard redirect loop on Cloudflare Pages#15
falkoro wants to merge 3 commits into
masterfrom
fix/remote-dashboard-redirect-loop

Conversation

@falkoro

@falkoro falkoro commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Problem

The Cloudflare _redirects rule (/ /index.html?demo=1 200) fought Pages' canonical URL normalization, causing an infinite //index.html redirect loop. Browsers often surface that as a cookies / redirect error.

Fix

  • Remove _redirects from deploys
  • Auto-enable demo mode when no ?api= is set (static Pages hosting)
  • Use ?demo=0 to disable demo if needed

Live

https://tokenmaxxing-remote.pages.dev/ (HTTP 200, demo animations work)

Remove reliance on _redirects (caused infinite / <-> /index.html loop and
browser cookie errors). Demo mode now auto-enables when no ?api= is set.
Copilot AI review requested due to automatic review settings June 10, 2026 18:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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=0 override) 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 thread remote/index.html
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 thread remote/index.html
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();
});
falkoro added 2 commits June 11, 2026 19:51
…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
@falkoro falkoro force-pushed the fix/remote-dashboard-redirect-loop branch from 51d8b65 to 4b36824 Compare June 11, 2026 19:51
@github-actions github-actions Bot added rust Pull requests that update rust code core labels Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants