{% if group_by_target and history_runs %} {# --- Grouped by target view --- #} {% set ns = namespace(groups={}) %} {% for run in history_runs %} {% set key = run.target_name or "No Target" %} {% if key not in ns.groups %} {% set _ = ns.groups.update({key: {"target_name": run.target_name, "target_id": run.target_id, "runs": []}}) %} {% endif %} {% set _ = ns.groups[key]["runs"].append(run) %} {% endfor %} {% for group_key, group in ns.groups.items() %}
{{ group_key }} {{ group.runs | length }} run{{ "s" if group.runs | length != 1 }} Latest: {{ group.runs[0].started_at.strftime('%Y-%m-%d %H:%M') if group.runs[0].started_at else "—" }}
{% for run in group.runs %} {{ run.display_name }} {{ run.target_name or "—" }} {% if prior_run_counts.get(run.target_id, 0) > 0 %} {{ prior_run_counts[run.target_id] }} prior run{{ "s" if prior_run_counts[run.target_id] != 1 }} {% endif %} {{ run.status.name | format_status }} {{ run.finding_count }} {{ run.duration or "—" }} {{ run.started_at.strftime('%Y-%m-%d %H:%M') if run.started_at else "—" }} {% if run.status.name in ('COMPLETED', 'PARTIAL', 'FAILED') %} {% if run.report_run_id %} {% else %} {% endif %} {% endif %} {% endfor %} {% endfor %} {% elif history_runs %} {# --- Flat list view --- #} {% for run in history_runs %} {{ run.display_name }} {{ run.target_name or "—" }} {% if prior_run_counts.get(run.target_id, 0) > 0 %} {{ prior_run_counts[run.target_id] }} prior run{{ "s" if prior_run_counts[run.target_id] != 1 }} {% endif %} {{ run.status.name | format_status }} {{ run.finding_count }} {{ run.duration or "—" }} {{ run.started_at.strftime('%Y-%m-%d %H:%M') if run.started_at else "—" }} {% if run.status.name in ('COMPLETED', 'PARTIAL', 'FAILED') %} {% if run.report_run_id %} {% else %} {% endif %} {% endif %} {% endfor %} {% else %}

No runs yet. Launch a workflow to get started.

{% endif %}