{# /opportunities summary cards. Audit always runs ``local_runtime_mode = True`` so we render the two-card local layout only - the cloud- only "Estimated Savings", "Projected Savings", "Clearing Savings", and the solution-readiness ``X ready / Y% coverage`` subvalues are gone (audit doesn't run dry-runs, doesn't generate Solutions, and refuses to surface the existing rules' hardcoded-percentage savings figures). #} {% from "components/_summary_card.html" import summary_card %} {# Build the "Query Cost" subvalues - Build / Consumption / Query breakdown depending on which buckets carry non-zero cost. #} {% set _cost_sub = [] %} {% if summary.build_query_cost %} {% set _ = _cost_sub.append("Build " ~ (summary.build_query_cost | format_usd)) %} {% endif %} {% if summary.consumption_query_cost %} {% set _ = _cost_sub.append("Consumption " ~ (summary.consumption_query_cost | format_usd)) %} {% endif %} {% if summary.other_query_cost %} {% set _ = _cost_sub.append("Query " ~ (summary.other_query_cost | format_usd)) %} {% endif %} {# Single metric: Flagged Jobs - the count of distinct queries that have ≥1 finding. Pairs 1:1 with the dashboard's "Flagged Jobs" card so the user sees the same number on both surfaces. The per-rule row count (``active_count``) is still rendered in the table below but we don't surface it as a headline. #} {% set _opp_sub = [] %} {% if summary.jobs_with_issue_count or summary.jobs_with_suggestion_count %} {% set _ = _opp_sub.append((summary.jobs_with_issue_count or 0) ~ " with issues") %} {% set _ = _opp_sub.append((summary.jobs_with_suggestion_count or 0) ~ " with suggestions") %} {% endif %}
{{ summary_card( "Flagged Jobs", summary.flagged_job_count, subvalues=_opp_sub if _opp_sub else ["across this scan"] ) }} {{ summary_card( "Query Cost", summary.total_query_cost | format_usd, subvalues=_cost_sub if _cost_sub else ["Per run"] ) }}