{# Single unified scan form. Save (project / region / dbt-only default) and run a scan on the chosen lookback in one submit — the only button is "Run scan". The page also surfaces the latest stats strip, an ADC pill, scan history, and quick links to the dashboard / settings. #} {% extends "layout.html" %} {% block content %}

Setup

Configuration

{{ adc_state.label }}

GCP Project: {{ config.gcp_project_id }} · Region: {{ config.bigquery_region }}

Last scan: {{ cache_stats.last_scan_at | timeago }}
{% if has_scan_data %} View dashboard {% endif %} Settings {% if active_principal %} Signed in as {{ active_principal }} {% endif %}
{# Auto-refresh while a scan is in flight so the user sees the running → succeeded transition without having to reload manually. ``scan_in_progress`` is set by the route based on the most-recent ScanRun row's status; it drives both the meta refresh AND the form's disabled state below. #} {% if scan_in_progress %} {% endif %} {% if scan_banner %}

{{ scan_banner.headline }}

{% if scan_banner.detail %}

{{ scan_banner.detail }}

{% endif %} {% if scan_in_progress %}

This page auto-refreshes every 5 seconds until the scan finishes.

{% endif %}
{% if scan_banner.level == 'success' and has_scan_data %} View dashboard {% endif %}
{% endif %} {% if errors and errors.get('_general') %}
{{ errors['_general'] }}
{% endif %} {# ── Unified Run-scan form: saves config + kicks off a scan ── #}
{% if gcp_projects %} {% for project in gcp_projects %} {% endfor %} {% endif %} {% if errors and errors.get('gcp_project_id') %}

{{ errors['gcp_project_id'] }}

{% endif %}
{# Datalist behaves as a typeahead in every modern browser: the user sees the full list on focus, and typing narrows it. #} {# Multi-regions #} {# US #} {# North + South America #} {# Europe #} {# Middle East + Africa #} {# Asia #} {# Oceania #} {% if errors and errors.get('bigquery_region') %}

{{ errors['bigquery_region'] }}

{% endif %}
BigQuery query preview
{{ scan_query_preview.sql }}
{% if scan_in_progress %} {% else %} {% endif %}
{# ── Scan history ── #}

Scan history

{{ scans | length }} most recent

{% if scans %}
{% for scan in scans %} {% endfor %}
Started Status Project Region Lookback Jobs dbt-only
{{ scan.started_at.strftime("%Y-%m-%d %H:%M") }} UTC {% if scan.status == "succeeded" %} succeeded {% elif scan.status == "failed" %} failed {% elif scan.status == "running" %} running {% else %} {{ scan.status }} {% endif %} {{ scan.gcp_project_id or "—" }} {{ scan.bigquery_region or "—" }} {{ scan.requested_lookback_days }}d {% if scan.fetched_job_count is not none %} {{ "{:,}".format(scan.fetched_job_count) }} {% else %} {% endif %} {% if scan.dbt_only_filter %} on {% else %} {% endif %}
{% else %}

No scans yet. Use the form above to run your first scan.

{% endif %}
{% endblock %}