{% extends "base.html" %} {% block title %}IT Overview{% endblock %} {% block page_title %}IT Operations Overview{% endblock %} {% block content %} {# ── Headline stat cards ───────────────────────────────────────────────────── #}
{% for label, value, icon, color, bg in [ ('Total Tickets', stats.total_tickets, 'bi-collection', 'var(--text)', 'rgba(255,255,255,.05)'), ('Open', stats.open, 'bi-circle', 'var(--info)', 'rgba(96,165,250,.1)'), ('In Progress', stats.in_progress, 'bi-arrow-repeat','var(--accent3)','rgba(0,180,216,.1)'), ('Resolved', stats.resolved, 'bi-check-circle','var(--success)','rgba(45,212,191,.1)'), ('Closed', stats.closed, 'bi-archive', 'var(--muted)', 'rgba(112,112,160,.1)'), ('Active Users', stats.total_users, 'bi-people', 'var(--accent2)','rgba(123,94,167,.1)'), ] %}
{{ value }}
{{ label }}
{% endfor %}
{# ── Row 1: Performance KPIs + Priority breakdown ─────────────────────────── #}
{# KPI cards #}
IT Performance — Last 30 Days
{# Avg resolution time #}
{% if avg_resolution_hours is none %}— {% elif avg_resolution_hours >= 24 %}{{ (avg_resolution_hours / 24)|round(1) }}d {% else %}{{ avg_resolution_hours }}h{% endif %}
Avg Resolution Time
{# Resolved last 7d #}
{{ resolved_7d }}
Resolved (7 days)
{# New last 7d #}
{{ new_7d }}
New (7 days)
{# Resolution rate 30d #}
{% set rate = ((resolved_30d / new_30d * 100)|int) if new_30d > 0 else 0 %}
{{ rate }}%
Resolution Rate (30d)
{# Unassigned #} {# SLA at-risk #}
{{ sla_breach }}
SLA At-Risk (>3 days)
{# Resolved 30d #}
{{ resolved_30d }}
Resolved (30 days)
{# New 30d #}
{{ new_30d }}
New (30 days)
{# Priority breakdown #}
Open by Priority
{% set total_open = priority_breakdown.values()|sum %} {% for priority, count in [ ('critical', priority_breakdown.critical), ('high', priority_breakdown.high), ('medium', priority_breakdown.medium), ('low', priority_breakdown.low), ] %}
{{ priority.upper() }} {{ count }}
{% endfor %}
Open by Category
{% for cat, count in category_breakdown %} {% if count > 0 %}
{{ cat }} {{ count }}
{% endif %} {% endfor %}
{# ── Row 2: Staff performance + Urgent queue ──────────────────────────────── #}
{# Staff performance table #}
IT Staff Performance
{% if staff_stats %} {% for s in staff_stats %} {% endfor %}
Staff Member Open Urgent Resolved (30d) Avg Time Total Resolved
{{ s.name }} {{ s.assigned_open }} {% if s.urgent_open > 0 %} {{ s.urgent_open }} {% else %} {% endif %} {{ s.resolved_30d }} {% if s.avg_hours is none %}— {% elif s.avg_hours >= 24 %}{{ (s.avg_hours / 24)|round(1) }}d {% else %}{{ s.avg_hours }}h{% endif %} {{ s.resolved_total }}
{% else %}
No IT staff found.
{% endif %}
{# Urgent open tickets queue #}
{% endblock %}