05/25 Improvement 1

This commit is contained in:
2026-05-25 12:23:59 -04:00
parent e375f1f70e
commit 9574d15f20
15 changed files with 610 additions and 82 deletions
+52 -19
View File
@@ -94,7 +94,10 @@
— {{ i.description[:60] }}{% if i.description|length > 60 %}…{% endif %}
</td>
<td style="padding:6px 8px;font-weight:600;color:#dc2626;">{{ i.severity|title }}</td>
<td style="padding:6px 8px;">{{ i.area.facility.name }} / {{ i.area.name }}</td>
<td style="padding:6px 8px;">
{% set rf = i.resolved_facility %}
{{ rf.name if rf else '—' }} / {{ i.area.name if i.area else '—' }}
</td>
<td style="padding:6px 8px;color:#64748b;">{{ i.reported_at.strftime('%b %d') }}</td>
</tr>
{% endfor %}
@@ -104,40 +107,70 @@
{% elif report.report_type == 'issues' %}
{# SLA summary bar #}
{% if issues %}
<h3 style="font-size:.9rem;border-bottom:1px solid #e2e8f0;padding-bottom:6px;">
Open Issues ({{ issues|length }})
<table width="100%" cellspacing="0" cellpadding="0" style="margin-bottom:20px;">
<tr>
<td align="center" style="padding:10px;background:#fef2f2;border-radius:8px;">
<div style="font-size:1.4rem;font-weight:700;color:#dc2626;">{{ sla_breached }}</div>
<div style="font-size:.75rem;color:#64748b;">SLA Breached</div>
</td>
<td width="12"></td>
<td align="center" style="padding:10px;background:#fefce8;border-radius:8px;">
<div style="font-size:1.4rem;font-weight:700;color:#b45309;">{{ sla_at_risk }}</div>
<div style="font-size:.75rem;color:#64748b;">At Risk</div>
</td>
<td width="12"></td>
<td align="center" style="padding:10px;background:#f0f9ff;border-radius:8px;">
<div style="font-size:1.4rem;font-weight:700;color:#0369a1;">{{ issues|length }}</div>
<div style="font-size:.75rem;color:#64748b;">Total Open</div>
</td>
</tr>
</table>
{# Per-facility sections #}
{% for facility_name, fac_issues in issues_by_facility %}
<h3 style="font-size:.85rem;border-bottom:1px solid #e2e8f0;padding-bottom:4px;margin-top:20px;">
&#127970; {{ facility_name }}
<span style="font-weight:400;color:#64748b;font-size:.78rem;">({{ fac_issues|length }} issue{{ 's' if fac_issues|length != 1 else '' }})</span>
</h3>
<table width="100%" style="border-collapse:collapse;font-size:.82rem;">
<table width="100%" style="border-collapse:collapse;font-size:.82rem;margin-bottom:8px;">
<thead>
<tr style="background:#f8fafc;">
<th style="padding:6px 8px;">#</th>
<th style="padding:6px 8px;">Severity</th>
<th style="padding:6px 8px;">Facility / Area</th>
<th style="padding:6px 8px;">Description</th>
<th style="padding:6px 8px;">Status</th>
<th style="padding:6px 8px;">Reported</th>
<th style="padding:5px 8px;text-align:left;">#</th>
<th style="padding:5px 8px;text-align:left;">Severity</th>
<th style="padding:5px 8px;text-align:left;">Area</th>
<th style="padding:5px 8px;text-align:left;">Description</th>
<th style="padding:5px 8px;text-align:left;">Status</th>
<th style="padding:5px 8px;text-align:left;">SLA</th>
<th style="padding:5px 8px;text-align:left;">Reported</th>
</tr>
</thead>
<tbody>
{% for i in issues %}
<tr style="border-bottom:1px solid #f1f5f9;">
<td style="padding:6px 8px;">
{% for i, sla in fac_issues %}
{% set row_bg = '#fef2f2' if sla == 'breached' else '#fefce8' if sla == 'at_risk' else '#fff' %}
<tr style="border-bottom:1px solid #f1f5f9;background:{{ row_bg }};">
<td style="padding:5px 8px;">
<a href="{{ base_url }}/issues/{{ i.id }}" style="color:#1d4ed8;">#{{ i.id }}</a>
</td>
<td style="padding:6px 8px;font-weight:600;color:{{ '#dc2626' if i.severity in ['critical','high'] else '#b45309' if i.severity == 'medium' else '#64748b' }}">
<td style="padding:5px 8px;font-weight:600;color:{{ '#dc2626' if i.severity in ['critical','high'] else '#b45309' if i.severity == 'medium' else '#64748b' }}">
{{ i.severity|title }}
</td>
<td style="padding:6px 8px;">{{ i.area.facility.name }} / {{ i.area.name }}</td>
<td style="padding:6px 8px;">{{ i.description[:80] }}{% if i.description|length > 80 %}…{% endif %}</td>
<td style="padding:6px 8px;">{{ i.status|replace('_',' ')|title }}</td>
<td style="padding:6px 8px;color:#64748b;">{{ i.reported_at.strftime('%b %d') }}</td>
<td style="padding:5px 8px;color:#64748b;">{{ i.area.name if i.area else '—' }}</td>
<td style="padding:5px 8px;">{{ i.description[:70] }}{% if i.description|length > 70 %}…{% endif %}</td>
<td style="padding:5px 8px;">{{ i.status|replace('_',' ')|title }}</td>
<td style="padding:5px 8px;font-weight:600;color:{{ '#dc2626' if sla == 'breached' else '#b45309' if sla == 'at_risk' else '#64748b' }}">
{{ 'Breached' if sla == 'breached' else 'At Risk' if sla == 'at_risk' else 'OK' }}
</td>
<td style="padding:5px 8px;color:#64748b;">{{ i.reported_at.strftime('%b %d') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
{% else %}
<p style="color:#64748b;">No open issues in this period.</p>
<p style="color:#64748b;">No open issues at this time.</p>
{% endif %}
{% endif %}
+9 -6
View File
@@ -21,18 +21,21 @@ FACILITY SCORES
OPEN CRITICAL / HIGH ISSUES
----------------------------
{% for i in critical_issues %}
#{{ i.id }} [{{ i.severity|title }}] {{ i.area.facility.name }} — {{ i.description[:80] }}
{% set rf = i.resolved_facility %}#{{ i.id }} [{{ i.severity|title }}] {{ rf.name if rf else '—' }} — {{ i.description[:80] }}
Link: {{ base_url }}/issues/{{ i.id }}
{% endfor %}
{% endif %}
{% elif report.report_type == 'issues' %}
OPEN ISSUES ({{ issues|length }})
OPEN ISSUES ({{ issues|length }}) — Breached: {{ sla_breached }} At Risk: {{ sla_at_risk }}
{% if issues %}
{% for i in issues %}
#{{ i.id }} [{{ i.severity|title }}] {{ i.area.facility.name }} / {{ i.area.name }}
Status: {{ i.status|replace('_',' ')|title }} | {{ i.description[:80] }}
Link: {{ base_url }}/issues/{{ i.id }}
{% for facility_name, fac_issues in issues_by_facility %}
{{ facility_name }} ({{ fac_issues|length }} issue{{ 's' if fac_issues|length != 1 else '' }})
{% for i, sla in fac_issues %} #{{ i.id }} [{{ i.severity|title }}] [SLA: {{ 'Breached' if sla == 'breached' else 'At Risk' if sla == 'at_risk' else 'OK' }}] {{ i.area.name if i.area else '—' }}
Status: {{ i.status|replace('_',' ')|title }} | {{ i.description[:70] }}
Link: {{ base_url }}/issues/{{ i.id }}
{% endfor %}
{% endfor %}
{% else %}
No open issues.