+ (p.discount_value / 100).toFixed(2) + ' off'} ${p.expires_at ? ' · expires ' + new Date(p.expires_at).toLocaleDateString() : ''} ${p.used_by ? '
used by ' + esc(p.used_by) : ''} ${p.redemptions}${p.max_redemptions ? ' / ' + p.max_redemptions : ''} used `, 'No promo codes yet.'))} ${section('checks', 'Does everything answer?', [], false, 0, `
Not run yet. These make live requests to Stripe, WorkOS and the scoring engine, so they run only when asked.
`)} ${section('settings', 'Settings and scheduled jobs', [], false, 0, `
Morning brief Sent daily at Eastern
Alert digest Hourly, when something has failed
`)} ${section('links', 'Elsewhere', [], false, 0, ``)}`; } async function load() { const key = localStorage.getItem(KEY_STORE); if (!key) return gate(); app.innerHTML = '

Loading…

'; try { const res = await fetch(GATEWAY + '/api/ops/overview', { headers: { 'X-Ops-Key': key } }); if (res.status === 401) { localStorage.removeItem(KEY_STORE); return gate('That key was not accepted.'); } if (!res.ok) throw new Error('Gateway returned ' + res.status); render(await res.json()); } catch (e) { // Say what failed. A blank screen on the monitoring is the worst outcome. app.innerHTML = `

Cannot reach the gateway

${esc(e.message)}

If the gateway is down, the app is down too.

`; } } load(); setInterval(load, 120000);