{# plugins/unifi/templates/unifi/dpi.html #} {% if not snapshot %}

No DPI data yet. DPI must be enabled on the UniFi controller.

{% else %}
{# Category breakdown #} {% if categories %}
Traffic by Category {{ snapshot.scraped_at.strftime("%H:%M") }}
{% set total_bytes = categories | sum(attribute='rx_bytes') + categories | sum(attribute='tx_bytes') %} {% for cat in categories[:20] %} {% set bytes = cat.rx_bytes + cat.tx_bytes %} {% set pct = (bytes / total_bytes * 100) if total_bytes else 0 %} {% endfor %}
{{ cat.cat_name or cat.cat_id }} {{ bytes|bytes }}
{% endif %} {# Top clients by DPI #} {% if top_clients %}
Top Clients by Traffic
{% for c in top_clients %} {% endfor %}
{{ c.hostname or c.mac }} {{ c.mac }} {% set bytes = c.bytes %} {{ bytes|bytes }}
{% endif %}
{% endif %}