{# T55 admin dashboard — terminal-brutalist re-skin. #}
{# Extends the new admin_layout.html. Data shape (collect_all_stats) is #}
{# unchanged; we render eight KPI panels as stat grids + mono data tables. #}
{% extends "admin_layout.html" %}
{% block page_title %}admin :: dashboard{% endblock %}
{% block breadcrumb %}
admin/
dashboard
{% endblock %}
{% block content %}
01 — operations
Stats. Eight panels, one truth.
KPIs aggregated by admin_stats.collect_all_stats. Volume, outcomes, cost, sandbox spend, and prompt-level reliability — all from the live scans + llm_calls tables. UTC throughout.
{# ===================== Volume + Outcomes ===================== #}
scan volume
last 7d
{{ volume.last_7_days }}
last 30d
{{ volume.last_30_days }}
Outcomes
success rate
{{ '%.1f'|format(outcome.success_rate * 100) }}%
{{ outcome.errored_count }} errored / {{ outcome.total_scans }} total
Top error reasons
{% if not outcome.top_error_reasons %}
// No errors recorded.
{% else %}
| reason | count |
{% for row in outcome.top_error_reasons %}
| {{ row.reason }} |
{{ row.count }} |
{% endfor %}
{% endif %}
{# ===================== Cost ===================== #}
cost
total
${{ '%.2f'|format(cost.total_usd) }}
today
${{ '%.2f'|format(cost.today_usd) }}
max / scan
${{ '%.4f'|format(cost.max_per_scan_usd) }}
avg / scan
${{ '%.4f'|format(cost.avg_per_scan_usd) }}
Prompt cost trend (30 days)
{% if not cost.prompt_cost_trend %}
// No LLM cost data in the last 30 days.
{% else %}
{% endif %}
{# ===================== Users + Sandbox spend ===================== #}
users
total users
{{ users.total_users }}
active (30d)
{{ users.active_30d }}
Top 5 spenders
{% if not users.top_5_spenders %}
// No spend recorded yet.
{% else %}
| user | scans | spend |
{% for row in users.top_5_spenders %}
{{ row.label }} |
{{ row.scan_count }} |
${{ '%.4f'|format(row.total_usd) }} |
{% endfor %}
{% endif %}
sandbox experiments
total
${{ '%.2f'|format(experiment_cost.total_usd) }}
today
${{ '%.2f'|format(experiment_cost.today_usd) }}
runs
{{ experiment_cost.experiment_count }}
Top experimenters
{% if not experiment_cost.top_experimenters %}
// No sandbox spend yet.
{% else %}
| admin | runs | spend |
{% for row in experiment_cost.top_experimenters %}
{{ row.label }} |
{{ row.experiment_count }} |
${{ '%.4f'|format(row.total_usd) }} |
{% endfor %}
{% endif %}
all experiments
{# ===================== LLM reliability ===================== #}
LLM reliability
{% if not llm_reliability.per_prompt %}
// No LLM calls recorded yet.
{% else %}
| prompt |
ok |
fail |
retries |
p95 (ms) |
{% for row in llm_reliability.per_prompt %}
{{ row.prompt_name }} |
{{ row.success_count }} |
{{ row.failure_count }} |
{{ row.retry_count }} |
{{ '%.0f'|format(row.p95_latency_ms) }} |
{% endfor %}
{% endif %}
{# ===================== Prompt cost ===================== #}
Prompt cost
{% if not prompt_cost.per_prompt %}
// No LLM cost data recorded yet.
{% else %}
| prompt |
calls |
avg |
max |
min |
{% for row in prompt_cost.per_prompt %}
{{ row.prompt_name }} |
{{ row.call_count }} |
${{ '%.4f'|format(row.avg_usd) }} |
${{ '%.4f'|format(row.max_usd) }} |
${{ '%.4f'|format(row.min_usd) }} |
{% endfor %}
{% endif %}
{# ===================== Top domains + templates ===================== #}
scan type — top domains
{% if not top_domains %}
// No scans yet.
{% else %}
| domain | scans |
{% for row in top_domains %}
{{ row.domain }} | {{ row.count }} |
{% endfor %}
{% endif %}
template — top scanned
{% if not top_templates %}
// No scans yet.
{% else %}
| template | scans |
{% for row in top_templates %}
{{ row.template }} | {{ row.count }} |
{% endfor %}
{% endif %}
{% endblock %}
{% block scripts %}
{% if cost.prompt_cost_trend %}
{% endif %}
{% endblock %}