Commit 2af9044
Add admin overview dashboard with aggregate stats and trend chart
- Add getAllUploads() DB function with JOIN to get github_login per row
- Add day index on usage_uploads for faster admin queries
- Admin dashboard (shown to is_admin users) includes:
- Aggregate stats card (today/7d/30d) with Active Users count
- Token usage trend chart for all users (by model/editor/by user)
- Top Users by token usage table (last 30 days)
- All Users list (collapsible, unchanged)
- By User grouping caps at top 10 users; others shown as 'Other'
- Admin today stats patched client-side using browser local timezone
- Admin section appears above personal data for immediate visibility
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent afe198c commit 2af9044
2 files changed
Lines changed: 387 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
153 | 154 | | |
154 | 155 | | |
155 | 156 | | |
| |||
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
260 | 275 | | |
261 | 276 | | |
262 | 277 | | |
| |||
0 commit comments