MC/website/web/account-ban-examples.js
Dev 6deb4a2e7d DuneRealms V2 clean baseline
Owner-authorised history reset; current source tree preserved exactly.
2026-11-13 00:05:14 +01:00

1 line
No EOL
1.3 KiB
JavaScript

(async()=>{const root=document.getElementById('account-records'),el=(tag,text)=>{const n=document.createElement(tag);if(text!==undefined)n.textContent=text;return n;};try{const r=await fetch('/api/public/account-bans',{cache:'no-store'});if(!r.ok)throw Error();const d=await r.json();root.replaceChildren();if(!d.bans.length){root.append(el('p','No account bans recorded.'));return;}for(const b of d.bans){const card=el('article');card.className='example-record';const art=el('div'),img=el('img');img.className='example-wax';img.src='/assets/account-banned-corrino-wax-v1.png';img.alt='DuneRealms — Banned, account revoked';art.append(img);const copy=el('div');copy.className='example-copy';const heading=el('small','ACCOUNT ACCESS PERMANENTLY REVOKED');heading.className='eyebrow';copy.append(heading,el('h2',b.account_name));const dl=el('dl');dl.className='example-ledger';for(const[k,v]of [['Status',b.status],['Reference',b.reference],['Reason',b.reason],['Issued by',b.issued_by],['Issued',new Intl.DateTimeFormat('en-GB',{dateStyle:'medium',timeStyle:'short',timeZone:'Europe/Brussels'}).format(new Date(Number(b.issued_at)))+' CET'],['Scope',b.scope],['Expires',b.expires]])dl.append(el('dt',k),el('dd',v));copy.append(dl);card.append(art,copy);root.append(card);}}catch{root.replaceChildren(el('p','Account ban records are temporarily unavailable.'));}})();