|
| 1 | +/** |
| 2 | + * Main Agent Observability Dashboard |
| 3 | + * |
| 4 | + * Primary landing page showing real-time agent activity across all projects |
| 5 | + */ |
| 6 | + |
| 7 | +import { Suspense } from 'react'; |
| 8 | +import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; |
| 9 | +import { Skeleton } from '@/components/ui/skeleton'; |
| 10 | +import { Activity, Zap, Clock, TrendingUp } from 'lucide-react'; |
| 11 | + |
| 12 | +export default function DashboardPage() { |
| 13 | + return ( |
| 14 | + <div className="container mx-auto py-6 space-y-6"> |
| 15 | + {/* Header */} |
| 16 | + <div className="flex items-center justify-between"> |
| 17 | + <div> |
| 18 | + <h1 className="text-3xl font-bold tracking-tight">Agent Activity Dashboard</h1> |
| 19 | + <p className="text-muted-foreground mt-2"> |
| 20 | + Monitor AI coding agents in real-time across all your projects |
| 21 | + </p> |
| 22 | + </div> |
| 23 | + </div> |
| 24 | + |
| 25 | + {/* Overview Stats */} |
| 26 | + <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4"> |
| 27 | + <Card> |
| 28 | + <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> |
| 29 | + <CardTitle className="text-sm font-medium">Active Sessions</CardTitle> |
| 30 | + <Activity className="h-4 w-4 text-muted-foreground" /> |
| 31 | + </CardHeader> |
| 32 | + <CardContent> |
| 33 | + <div className="text-2xl font-bold">0</div> |
| 34 | + <p className="text-xs text-muted-foreground">No active agent sessions</p> |
| 35 | + </CardContent> |
| 36 | + </Card> |
| 37 | + |
| 38 | + <Card> |
| 39 | + <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> |
| 40 | + <CardTitle className="text-sm font-medium">Total Events Today</CardTitle> |
| 41 | + <Zap className="h-4 w-4 text-muted-foreground" /> |
| 42 | + </CardHeader> |
| 43 | + <CardContent> |
| 44 | + <div className="text-2xl font-bold">0</div> |
| 45 | + <p className="text-xs text-muted-foreground">Agent events logged</p> |
| 46 | + </CardContent> |
| 47 | + </Card> |
| 48 | + |
| 49 | + <Card> |
| 50 | + <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> |
| 51 | + <CardTitle className="text-sm font-medium">Avg Session Duration</CardTitle> |
| 52 | + <Clock className="h-4 w-4 text-muted-foreground" /> |
| 53 | + </CardHeader> |
| 54 | + <CardContent> |
| 55 | + <div className="text-2xl font-bold">-</div> |
| 56 | + <p className="text-xs text-muted-foreground">No sessions yet</p> |
| 57 | + </CardContent> |
| 58 | + </Card> |
| 59 | + |
| 60 | + <Card> |
| 61 | + <CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2"> |
| 62 | + <CardTitle className="text-sm font-medium">Events Per Minute</CardTitle> |
| 63 | + <TrendingUp className="h-4 w-4 text-muted-foreground" /> |
| 64 | + </CardHeader> |
| 65 | + <CardContent> |
| 66 | + <div className="text-2xl font-bold">0</div> |
| 67 | + <p className="text-xs text-muted-foreground">Current rate</p> |
| 68 | + </CardContent> |
| 69 | + </Card> |
| 70 | + </div> |
| 71 | + |
| 72 | + {/* Recent Activity */} |
| 73 | + <Card> |
| 74 | + <CardHeader> |
| 75 | + <CardTitle>Recent Agent Activity</CardTitle> |
| 76 | + </CardHeader> |
| 77 | + <CardContent> |
| 78 | + <div className="flex flex-col items-center justify-center py-12 text-center"> |
| 79 | + <div className="text-muted-foreground mb-4 text-4xl">🤖</div> |
| 80 | + <h3 className="text-lg font-semibold mb-2">No Agent Activity Yet</h3> |
| 81 | + <p className="text-sm text-muted-foreground max-w-md"> |
| 82 | + Start monitoring your AI coding agents by configuring collectors and starting agent sessions. |
| 83 | + Visit the Settings page to set up your first collector. |
| 84 | + </p> |
| 85 | + </div> |
| 86 | + </CardContent> |
| 87 | + </Card> |
| 88 | + |
| 89 | + {/* Active Sessions */} |
| 90 | + <Card> |
| 91 | + <CardHeader> |
| 92 | + <CardTitle>Live Agent Sessions</CardTitle> |
| 93 | + </CardHeader> |
| 94 | + <CardContent> |
| 95 | + <Suspense fallback={<Skeleton className="h-32 w-full" />}> |
| 96 | + <div className="text-sm text-muted-foreground text-center py-8"> |
| 97 | + No active sessions |
| 98 | + </div> |
| 99 | + </Suspense> |
| 100 | + </CardContent> |
| 101 | + </Card> |
| 102 | + </div> |
| 103 | + ); |
| 104 | +} |
0 commit comments