2026-06-08 15:38:33 +00:00
{% extends "admin_base.html" %}
{% block extra_head %}
{{ super() }}
< link rel = "stylesheet" href = "/static/css/services.css" >
< link rel = "stylesheet" href = "/static/css/ai_usage.css" >
{% endblock %}
{% block admin_content %}
< div class = "admin-toolbar" >
< h2 > AI usage</ h2 >
< div class = "ai-usage-controls" >
< label > Window
< select id = "ai-usage-window" >
< option value = "1" > 1 hour</ option >
< option value = "24" > 24 hours</ option >
< option value = "48" selected > 48 hours</ option >
< option value = "168" > 7 days</ option >
</ select >
</ label >
< label >< input type = "checkbox" id = "ai-usage-divided" > Show breakdowns</ label >
< span class = "ai-usage-generated" data-meta = "generated" > -</ span >
2026-06-08 22:30:25 +00:00
< form method = "POST" action = "/admin/ai-quota/reset-guests" class = "admin-inline-form" >
2026-06-09 14:06:02 +00:00
< button type = "submit" class = "admin-btn admin-btn-sm" data-confirm-danger data-confirm = "Reset guest AI quotas for all guests?" >< span class = "icon" > 🔄 </ span > Reset guest quotas</ button >
2026-06-08 22:30:25 +00:00
</ form >
< form method = "POST" action = "/admin/ai-quota/reset-all" class = "admin-inline-form" >
2026-06-09 14:06:02 +00:00
< button type = "submit" class = "admin-btn admin-btn-sm" data-confirm-danger data-confirm = "Reset AI quotas for every user and guest?" >< span class = "icon" > 🔄 </ span > Reset all quotas</ button >
2026-06-08 22:30:25 +00:00
</ form >
2026-06-08 15:38:33 +00:00
</ div >
</ div >
< div id = "ai-usage-root" class = "ai-usage" >
< p class = "admin-empty" data-empty > Loading metrics...</ p >
</ div >
{% endblock %}
{% block extra_js %}
< script type = "module" src = "/static/js/AiUsageMonitor.js" ></ script >
< script type = "module" >
new window . AiUsageMonitor (). start ();
</ script >
{% endblock %}