feat(admin): legacy-panel banner — new admin lives at robotmonster.party/admin + copy-my-token

The owner token is per-browser localStorage, so a sign-in here doesn't carry across domains;
the banner hands you the token to paste into the new panel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
type-two 2026-07-02 17:40:40 +10:00
parent c44e6643db
commit b6994a96e3

View File

@ -92,10 +92,22 @@
<a onclick="signOut()" style="cursor:pointer">🚪 Sign out</a>
<a href="/">← Home</a>
</nav>
<main id="content"></main>
<main>
<div style="background:#fdeef6;border:1px solid #c2187e;border-radius:10px;padding:10px 14px;margin-bottom:14px;font-size:13px;display:flex;gap:10px;align-items:center;flex-wrap:wrap">
<span>⚠️ <b>Legacy panel.</b> The store admin now lives at <a href="https://robotmonster.party/admin" style="color:#c2187e"><b>robotmonster.party/admin</b></a> — your sign-in token here works there too.</span>
<button onclick="legacyCopyToken()" style="cursor:pointer">📋 Copy my token</button>
<span id="legacyMsg" style="color:#666;font-size:12px"></span>
</div>
<div id="content"></div>
</main>
</div>
<script>
async function legacyCopyToken(){
const t=localStorage.getItem('rg_token')||'', m=document.getElementById('legacyMsg');
try{ await navigator.clipboard.writeText(t); if(m) m.textContent='copied — paste it into the sign-in at robotmonster.party/admin'; }
catch(e){ if(m) m.textContent='clipboard blocked — token: '+t; }
}
const $ = s => document.querySelector(s);
let TOKEN = localStorage.getItem('rg_token') || '';
const hdr = () => ({ 'Authorization': 'Bearer ' + TOKEN, 'Content-Type': 'application/json' });