mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-07 05:56:41 +02:00
78840c64a8
Dashboard: Supabase edge function serving self-contained HTML with PKCE OAuth, 6 parallel client-side REST queries, SVG charts, dark theme, auto-refresh, who's-online from heartbeats. Public URL. Regression alert: webhook on eval_runs INSERT, 5-min cooldown dedup via alert_cooldowns, Slack notification on >5% pass rate drop. Weekly digest: pg_cron Monday 9am UTC, aggregates 7-day team data, Slack message with evals/ships/sessions/costs. 15 tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
24 lines
656 B
TypeScript
24 lines
656 B
TypeScript
/**
|
|
* Dashboard edge function — serves the team dashboard HTML.
|
|
*
|
|
* Public URL: https://<project>.supabase.co/functions/v1/dashboard
|
|
* No auth required (the HTML page handles auth client-side via PKCE).
|
|
*/
|
|
|
|
import { getDashboardHTML } from './ui.ts';
|
|
|
|
Deno.serve((_req: Request) => {
|
|
const supabaseUrl = Deno.env.get('SUPABASE_URL') ?? '';
|
|
const anonKey = Deno.env.get('SUPABASE_ANON_KEY') ?? '';
|
|
|
|
const html = getDashboardHTML(supabaseUrl, anonKey);
|
|
|
|
return new Response(html, {
|
|
status: 200,
|
|
headers: {
|
|
'Content-Type': 'text/html; charset=utf-8',
|
|
'Cache-Control': 'no-cache, no-store, must-revalidate',
|
|
},
|
|
});
|
|
});
|