Spaces:
Running
Running
Upgrade admin dashboard to terminal-style dark theme
Browse files- GitHub-inspired dark theme with monospace fonts
- Compact summary bar: Active Sessions | Total Requests | Providers
- Sessions table with Session ID, Requests, Providers, Last Active, Req/Min
- Provider Load table with Active, Sessions, Req/Min, Status
- Green checkmark for healthy, warning icon for rate limited
- Auto-refresh every 10 seconds
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 unmodified lines56788101112131415161791011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181192122232425262712029303132333435363738394041424344454647484950515253121122123124125126127128129130575859131132133616263646566676869707172737475767778798081828384858687881341351361371381391401411421431441451461471481491501511521531541551561571581591601619016216316416594959616616716898991001011021031041051061071081091101111121131141151161171181191201211221231241251261271691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981291992002012021331341352032042052062072084 unmodified lines <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="refresh" content="10"> <title>Claude Code Proxy - Admin Dashboard</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body { background-color: #f8f9fa; } .dashboard-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 2rem 0; margin-bottom: 2rem; } .stat-card { border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); } .table-container { background: white; border-radius: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); padding: 1.5rem; margin-bottom: 2rem; } .section-title { color: #495057; font-weight: 600; margin-bottom: 1rem; border-bottom: 2px solid #dee2e6; padding-bottom: 0.5rem; } .status-healthy { color: #198754; font-weight: 500; } .status-limited { color: #dc3545; font-weight: 500; } .session-id { font-family: monospace; font-size: 0.9em; } * { box-sizing: border-box; } body { background-color: #0d1117; color: #c9d1d9; font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace; font-size: 13px; line-height: 1.5; margin: 0; padding: 20px; } .container { max-width: 1200px; margin: 0 auto; } .header { color: #58a6ff; font-size: 18px; font-weight: bold; margin-bottom: 20px; } .summary { background: #161b22; border: 1px solid #30363d; border-radius: 6px; padding: 12px 16px; margin-bottom: 20px; font-size: 14px; } .summary-line { color: #8b949e; } .summary-line span { color: #58a6ff; font-weight: bold; } .section { background: #161b22; border: 1px solid #30363d; border-radius: 6px; padding: 12px 16px; margin-bottom: 20px; } .section-title { color: #58a6ff; font-weight: bold; margin-bottom: 12px; font-size: 14px; } .divider { color: #30363d; margin: 8px 0; } table { width: 100%; border-collapse: collapse; } th { text-align: left; color: #8b949e; font-weight: normal; padding: 6px 8px; border-bottom: 1px solid #30363d; font-size: 12px; } td { padding: 6px 8px; border-bottom: 1px solid #21262d; } tr:last-child td { border-bottom: none; } .session-id { color: #f0883e; font-family: monospace; } .provider-badge { display: inline-block; background: #1f6feb; color: #ffffff; padding: 2px 6px; border-radius: 3px; font-size: 11px; margin-right: 4px; } .status-healthy { color: #3fb950; } .status-limited { color: #f85149; } .empty { color: #8b949e; font-style: italic; } .footer { color: #8b949e; font-size: 11px; text-align: center; margin-top: 20px; } .footer a { color: #58a6ff; text-decoration: none; } .footer a:hover { text-decoration: underline; } .number { color: #79c0ff; font-weight: bold; } </style></head><body> <div class="dashboard-header"> <div class="container"> <h1 class="mb-0">Claude Code Proxy - Admin Dashboard</h1> <p class="mb-0 mt-2 opacity-75">Session Monitoring & Provider Load</p> </div> </div>
<div class="container"> <!-- Summary Stats --> <div class="row mb-4"> <div class="col-md-4"> <div class="card stat-card bg-primary text-white"> <div class="card-body"> <h5 class="card-title">Active Sessions</h5> <h2 class="mb-0">{{ summary.active_sessions }}</h2> </div> </div> </div> <div class="col-md-4"> <div class="card stat-card bg-success text-white"> <div class="card-body"> <h5 class="card-title">Total Requests</h5> <h2 class="mb-0">{{ summary.total_requests }}</h2> </div> </div> </div> <div class="col-md-4"> <div class="card stat-card bg-info text-white"> <div class="card-body"> <h5 class="card-title">Providers</h5> <h2 class="mb-0">{{ summary.providers }}</h2> </div> </div> <div class="header">Claude Code Proxy - Admin Dashboard</div>
<div class="summary"> <div class="summary-line"> Active Sessions: <span>{{ summary.active_sessions }}</span> | Total Requests: <span>{{ summary.total_requests }}</span> | Providers: <span>{{ summary.providers }}</span> </div> </div>
<!-- Sessions Table --> <div class="table-container"> <h3 class="section-title">Sessions</h3> <div class="section"> <div class="section-title">Sessions</div> {% if sessions %} <div class="table-responsive"> <table class="table table-hover"> <thead class="table-light"> <tr> <th>Session ID</th> <th>Requests</th> <th>Providers</th> <th>Last Active</th> <th>Req/Min</th> </tr> </thead> <tbody> {% for session in sessions %} <tr> <td class="session-id" title="{{ session.session_id }}">{{ session.session_id[:12] }}...</td> <td>{{ session.total_requests }}</td> <td> {% for provider in session.providers %} <span class="badge bg-secondary">{{ provider }}</span> {% endfor %} </td> <td>{{ session.last_activity_display }}</td> <td>{{ session.requests_per_minute }}</td> </tr> {% endfor %} </tbody> </table> </div> <div class="divider">βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ</div> <table> <thead> <tr> <th>Session ID</th> <th>Requests</th> <th>Providers</th> <th>Last Active</th> <th>Req/Min</th> </tr> </thead> <tbody> {% for session in sessions %} <tr> <td class="session-id">{{ session.session_id[:12] }}...</td> <td class="number">{{ session.total_requests }}</td> <td> {% for provider in session.providers %} <span class="provider-badge">{{ provider }}</span> {% endfor %} </td> <td>{{ session.last_activity_display }}</td> <td class="number">{{ session.requests_per_minute }}</td> </tr> {% endfor %} </tbody> </table> {% else %} <p class="text-muted">No active sessions</p> <p class="empty">No active sessions</p> {% endif %} </div>
<!-- Provider Load Table --> <div class="table-container"> <h3 class="section-title">Provider Load</h3> <div class="section"> <div class="section-title">Provider Load</div> {% if providers %} <div class="table-responsive"> <table class="table table-hover"> <thead class="table-light"> <tr> <th>Provider</th> <th>Active</th> <th>Sessions</th> <th>Req/Min</th> <th>Status</th> </tr> </thead> <tbody> {% for provider in providers %} <tr> <td class="session-id">{{ provider.provider_id }}</td> <td>{{ provider.active_requests }}</td> <td>{{ provider.sessions_count }}</td> <td>{{ provider.requests_per_minute }}</td> <td> {% if provider.is_healthy %} <span class="status-healthy">β {{ provider.status }}</span> {% else %} <span class="status-limited">β {{ provider.status }}</span> {% endif %} </td> </tr> {% endfor %} </tbody> </table> </div> <div class="divider">βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ</div> <table> <thead> <tr> <th>Provider</th> <th>Active</th> <th>Sessions</th> <th>Req/Min</th> <th>Status</th> </tr> </thead> <tbody> {% for provider in providers %} <tr> <td class="session-id">{{ provider.provider_id }}</td> <td class="number">{{ provider.active_requests }}</td> <td class="number">{{ provider.sessions_count }}</td> <td class="number">{{ provider.requests_per_minute }}</td> <td> {% if provider.is_healthy %} <span class="status-healthy">✓ {{ provider.status }}</span> {% else %} <span class="status-limited">⚠ {{ provider.status }}</span> {% endif %} </td> </tr> {% endfor %} </tbody> </table> {% else %} <p class="text-muted">No provider data</p> <p class="empty">No provider data</p> {% endif %} </div>
<footer class="text-center text-muted py-3"> <small>Auto-refreshes every 10 seconds β’ <a href="/api/admin/sessions">JSON API</a></small> </footer> <div class="footer"> Auto-refreshes every 10 seconds • <a href="/api/admin/sessions">JSON API</a> </div> </div></body></html>templates/admin.html+180-110