{% extends 'base.html' %} {% block title %}Patching {{ year }}{% endblock %} {% block content %}
< Audit complet

Patching {{ year }}

2025 2026 | Tous SecOps Hors SecOps
{% if kpis_secops and kpis_other %}
SecOps
{{ kpis_secops.patched }}/{{ kpis_secops.total }}
{% set pct_s = (kpis_secops.patched / kpis_secops.total * 100)|int if kpis_secops.total > 0 else 0 %}
{{ pct_s }}%
Hors SecOps
{{ kpis_other.patched }}/{{ kpis_other.total }}
{% set pct_o = (kpis_other.patched / kpis_other.total * 100)|int if kpis_other.total > 0 else 0 %}
{{ pct_o }}%
{% endif %} {% if kpis %} {% set pct = (kpis.patched / kpis.total * 100)|int if kpis.total > 0 else 0 %}
{{ kpis.total }}
Total
{{ kpis.patched }}
Patchés
{{ kpis.once }}
1 fois
{{ kpis.twice }}
2+ fois
{{ kpis.thrice }}
3+ fois
{{ kpis.never }}
Jamais
{{ pct }}%
Couverture
{% if compare and year == 2026 %} {% set pct_current = (compare.current_patched / compare.total * 100)|int if compare.total > 0 else 0 %} {% set pct_prev = (compare.prev_year_total / compare.total * 100)|int if compare.total > 0 else 0 %} {% set diff = compare.current_patched - compare.prev_year_total %} {% set diff_pct = pct_current - pct_prev %}
Comparaison 2026 (S14) vs 2025 (année complète)
2026 (en cours) {{ compare.current_patched }} / {{ compare.total }} ({{ pct_current }}%)
2025 (total) {{ compare.prev_year_total }} / {{ compare.total }} ({{ pct_prev }}%)
{% if diff >= 0 %}+{% endif %}{{ diff }}
{% if diff_pct >= 0 %}+{% endif %}{{ diff_pct }} pts vs 2025
S14 vs année complète
{% endif %}
{% if patch_weekly %}
Serveurs par semaine vert=patché rouge=annulé/reporté
{% set max_cnt = patch_weekly|map(attribute='patched')|map('int')|max %} {% for w in patch_weekly %} {% set total = (w.patched|int) + (w.cancelled|int) %} {% set max_total = max_cnt if max_cnt > 0 else 1 %}
{{ total }}
{% if w.cancelled|int > 0 %}
{% endif %}
{{ w.week }}
{% endfor %}
{% endif %}
Par domaine
{% for d in patch_by_domain %} {% set dp = (d.patched / d.total * 100)|int if d.total > 0 else 0 %} {% endfor %}
DomaineTotalOK2xJamais%
{{ d.domain }} {{ d.total }} {{ d.patched }} {{ d.twice }} {{ d.never }}
{{ dp }}%
{% endif %}
{% if scope %}{% endif %} {% if search or domain %}Reset{% endif %}
{{ total_filtered }} serveur(s)
{% set qs %}{% if search %}&q={{ search }}{% endif %}{% if domain %}&domain={{ domain }}{% endif %}{% if scope %}&scope={{ scope }}{% endif %}{% endset %}
{% for s in servers %} {% endfor %}
Hostname {% if sort == 'hostname' %}{{ '▲' if sort_dir == 'asc' else '▼' }}{% endif %} Domaine Env Zone Nb patchs {% if sort == 'count' %}{{ '▲' if sort_dir == 'asc' else '▼' }}{% endif %} Semaines Dernier {% if sort == 'last' %}{{ '▲' if sort_dir == 'asc' else '▼' }}{% endif %}
{{ s.hostname }} {{ s.domain or '-' }} {{ (s.env or '-')[:6] }} {% if s.zone == 'DMZ' %}DMZ{% else %}{{ s.zone or '-' }}{% endif %} {{ s.patch_count or 0 }} {% if s.patch_weeks %}{% for w in s.patch_weeks.split(',') %}{{ w }}{% endfor %}{% else %}-{% endif %} {% if s.last_patch_date %}{{ s.last_patch_date }}{% elif s.last_patch_week %}{{ s.last_patch_week }}{% else %}-{% endif %}
{% if total_pages > 1 %} {% set pqs %}&year={{ year }}{% if search %}&q={{ search }}{% endif %}{% if domain %}&domain={{ domain }}{% endif %}{% if scope %}&scope={{ scope }}{% endif %}{% if sort %}&sort={{ sort }}&dir={{ sort_dir }}{% endif %}{% endset %}
Page {{ page }}/{{ total_pages }}
{% if page > 1 %}1{% if page > 2 %}<{% endif %}{% endif %} {{ page }} {% if page < total_pages %}>{{ total_pages }}{% endif %}
{% endif %}
{% endblock %}