{# Audit dashboard - adapted from governor_web/templates/dashboard/index.html @ 19455c57c5a9. Same layout grammar (ui-shell → ui-page-header → stat cards → main grid with cost drivers + active issues panes) so the styling matches governor-web 1:1. The audit package's empty-state redirect lives at the route level, so this template only renders when there is data to show. #} {% extends "layout.html" %} {% block content %}

Dashboard

Configuration & re-scan →
{# ── Headline card - single dollar value that answers "what is Governor telling me to act on?". flagged_spend is the sum of cached job cost across jobs with ≥1 active opportunity, deduped by job_id. The "Review opportunities" CTA turns this from a passive report into an actionable workflow surface. #} {% if totals.flagged_spend and totals.flagged_spend > 0 %}

Optimisable spend

{{ totals.flagged_spend | format_usd }}

Across {{ "{:,}".format(totals.total_issues) }} flagged finding{{ "s" if totals.total_issues != 1 else "" }} {% if totals.total_cost_usd and totals.flagged_spend %} · {{ "%.0f" | format(totals.flagged_spend / totals.total_cost_usd * 100) }}% of scanned spend {% endif %}

Review opportunities
{% endif %} {# ── Next actions - top three destination tables ranked by *aggregated* cost across all flagged executions, not per-execution cost. A model that ran 20 times at $10 ($200 total) outranks a one-off $100 query. Skipped when fewer than two qualifying tables have an opportunity_id (avoid showing a stunted list). #} {% if next_actions and next_actions | length >= 2 %} {% from "components/_section_title.html" import section_title %}
{{ section_title( "Next actions", description="The three destination tables with the highest aggregated cost across every flagged execution. Acting on these first delivers the largest reduction in optimisable spend." ) }}
    {% for j in next_actions %}
  1. {{ loop.index }} {{ j.destination_dataset }}.{{ j.destination_object }} ran {{ j.execution_count }} time{{ "s" if j.execution_count != 1 else "" }} {% if j.issue_count > 0 %} · {{ j.issue_count }} issue{{ "s" if j.issue_count != 1 else "" }}{% endif %} {% if j.suggestion_count > 0 %} · {{ j.suggestion_count }} suggestion{{ "s" if j.suggestion_count != 1 else "" }}{% endif %} {{ j.cost_usd | format_usd }}
  2. {% endfor %}
{% endif %} {# ── Stat cards (secondary, supporting context to the headline) ── #}
{% include "dashboard/_cost_summary.html" %}
{# ── Main grid: bar chart + cost drivers ── The "Active Issues" rule-type breakdown was removed - issues are listed (and filterable) on /opportunities, so a duplicate card here was just extra scrolling. #}
{% include "dashboard/_trend_chart.html" %}
{% include "dashboard/_cost_drivers.html" %}
{# Top Failed Jobs widget removed - failed jobs don't carry direct on-demand BigQuery cost (BigQuery refunds bytes-billed on most failure modes), and a second 10-row table on the dashboard diluted the cost-first narrative. Reliability detail lives on /failures (sidebar nav) where it belongs. #}
{% endblock %}