{% extends "_base.html" %} {% from "_partials.html" import avatar %} {% set active = 'usage' %} {% block title %}trovex — usage{% endblock %} {% block topbar_meta %} {{ total_queries }} queries · {{ unique_users }} users {% endblock %} {# ── Derive an aggregate volume series from the per-user sparklines ──── #} {# Route already passes 24-bucket sparklines per user; summing them is a #} {# view-side roll-up, not invented data. #} {% set ns = namespace(buckets=[], total=0, peak=0) %} {% if per_user %} {% set first_len = (per_user | map(attribute='sparkline') | select | map('length') | list) %} {% if first_len %} {% set width = first_len | max %} {% for i in range(width) %} {% set col = namespace(sum=0) %} {% for u in per_user %} {% if u.sparkline and i < (u.sparkline | length) %} {% set col.sum = col.sum + u.sparkline[i] %} {% endif %} {% endfor %} {% set _ = ns.buckets.append(col.sum) %} {% set ns.total = ns.total + col.sum %} {% if col.sum > ns.peak %}{% set ns.peak = col.sum %}{% endif %} {% endfor %} {% endif %} {% endif %} {% block content %}