Jul 9 - Update Dashboard separate open issue by Handled by

This commit is contained in:
2026-07-09 12:12:07 -04:00
parent 138e44c47d
commit 53ba27370d
3 changed files with 36 additions and 9 deletions
+7
View File
@@ -95,6 +95,12 @@ def index():
'medium': sum(1 for i in open_issues_all if i.severity == 'medium'),
'low': sum(1 for i in open_issues_all if i.severity == 'low'),
}
# Open issues split by who handles them (phase35) — same list, no extra query.
handler_breakdown = {
'internal': sum(1 for i in open_issues_all if (i.handler_type or 'internal') == 'internal'),
'facility': sum(1 for i in open_issues_all if i.handler_type == 'facility'),
'vendor': sum(1 for i in open_issues_all if i.handler_type == 'vendor'),
}
# ── Issues resolved today ─────────────────────────────────────────────────
resolved_today_q = Issue.query.filter(
@@ -362,6 +368,7 @@ def index():
completed_today = completed_today,
open_issues = open_issues,
severity_breakdown = severity_breakdown,
handler_breakdown = handler_breakdown,
resolved_today = resolved_today,
pending_followups = pending_followups,
issues_opened_today = issues_opened_today,
+28 -8
View File
@@ -139,26 +139,46 @@
<div class="row g-3 mb-4">
<div class="col-6 col-md">
<a href="{{ url_for('issues.index', status='open') }}" class="text-decoration-none">
<div class="card text-white bg-warning h-100">
<div class="card-body">
<div class="d-flex justify-content-between align-items-start mb-1">
<span class="small text-white-50 fw-semibold">Open Issues</span>
<i class="bi bi-exclamation-triangle" style="font-size:1.4rem;opacity:.3;"></i>
</div>
<div class="fs-1 fw-bold lh-1">{{ open_issues }}</div>
<div class="mt-2" style="font-size:.72rem;opacity:.75;">
Active issues not yet resolved
{% if open_issues > 0 %}
· {% if severity_breakdown.critical > 0 %}<span class="badge bg-danger">{{ severity_breakdown.critical }}C</span> {% endif %}
<a href="{{ url_for('issues.index', status='open') }}" class="text-white text-decoration-none">
<div class="fs-1 fw-bold lh-1">{{ open_issues }}</div>
</a>
{% if open_issues > 0 %}
<div class="mt-2" style="font-size:.72rem;opacity:.85;">
{% if severity_breakdown.critical > 0 %}<span class="badge bg-danger">{{ severity_breakdown.critical }}C</span> {% endif %}
{% if severity_breakdown.high > 0 %}<span class="badge bg-danger">{{ severity_breakdown.high }}H</span> {% endif %}
{% if severity_breakdown.medium > 0 %}<span class="badge bg-dark">{{ severity_breakdown.medium }}M</span> {% endif %}
{% if severity_breakdown.low > 0 %}<span class="badge bg-secondary">{{ severity_breakdown.low }}L</span>{% endif %}
{% endif %}
</div>
{# ── Split by who handles it (click to drill in) ── #}
<div class="mt-1 d-flex flex-wrap align-items-center gap-1" style="font-size:.7rem;">
<span style="opacity:.75;">Handled by:</span>
{% if handler_breakdown.internal > 0 %}
<a href="{{ url_for('issues.index', status='open', handler_type='internal') }}"
class="badge bg-primary text-decoration-none" title="Janitorial Staff">
<i class="bi bi-people"></i> {{ handler_breakdown.internal }}
</a>{% endif %}
{% if handler_breakdown.facility > 0 %}
<a href="{{ url_for('issues.index', status='open', handler_type='facility') }}"
class="badge bg-info text-dark text-decoration-none" title="Facility Staff">
<i class="bi bi-building"></i> {{ handler_breakdown.facility }}
</a>{% endif %}
{% if handler_breakdown.vendor > 0 %}
<a href="{{ url_for('issues.index', status='open', handler_type='vendor') }}"
class="badge bg-light text-dark border text-decoration-none" title="External Vendor">
<i class="bi bi-person-gear"></i> {{ handler_breakdown.vendor }}
</a>{% endif %}
</div>
{% else %}
<div class="mt-2" style="font-size:.72rem;opacity:.75;">Active issues not yet resolved</div>
{% endif %}
</div>
</div>
</a>
</div>
<div class="col-6 col-md">