{# Partial: security dashboard counter cards. Used by: - security/dashboard.html (full page) - /security/stats endpoint (HTMX live polling) Context: - stats: AuditStats - active_session_count: int - mfa_adoption: float (0..100) - mfa_enabled_users, total_users: int - live: bool — when True, the wrapping div polls /security/stats This partial owns the wrapping `
` so it can replace itself on swap. #}
Events (7 days)
{{ stats.total_events | default(0) }}
{% set failed = stats.failure_count | default(0) %} {% set total = stats.total_events | default(0) %}
Failed Events
{{ failed }} {% if total > 0 %} ({{ ((failed / total) * 100) | round(1) }}%) {% endif %}
Active Sessions
{{ active_session_count }}
MFA Adoption
{{ mfa_adoption | round(1) }}% ({{ mfa_enabled_users }}/{{ total_users }} users)