{% extends "base.html" %} {% block content %} {# ── Status hero ──────────────────────────────────────────── #}
{% if banner.state == "Healthy" %}
{% elif banner.state == "Scan running" %}
{% elif banner.state == "Issues found" %}
{% elif banner.state in ["Configuration needed", "Access problem suspected"] %}
{% else %}
{% endif %}
{{ status.files_indexed | default(0) | int }} files indexed  · 
{% set scheduler = status.get("scheduler") %}
Scheduler
{% if scheduler and scheduler.get("last_error") %} Schedule unavailable {% elif scheduler and scheduler.get("next_run_at") %} Next scan {{ scheduler.get("next_run_at") }} {% elif scheduler and scheduler.get("enabled") %} Scheduler enabled {% else %} Scheduler disabled {% endif %}
{% if scheduler and scheduler.get("last_error") %} Fix the schedule expression in Configuration. {% elif scheduler and scheduler.get("next_run_at") %} scheduled automatically {% else %} waiting for a schedule {% endif %}
{% if scheduler and scheduler.get('last_error') %} Error {% elif scheduler and scheduler.get('enabled') %} Active {% else %} Disabled {% endif %}
Last scheduled run
{% if scheduler and scheduler.get("last_run_at") %} {{ scheduler.get("last_run_at") }} {% else %} Never {% endif %}
Last result
{{ scheduler.get("last_trigger_result") if scheduler and scheduler.get("last_trigger_result") else "No runs yet" }}
Schedule
{{ scheduler.get("cron") if scheduler and scheduler.get("cron") else "disabled" }}
{% if scheduler and scheduler.get("last_error") %} {{ scheduler.get("last_error") }} {% endif %}
{# ── Stat cards ───────────────────────────────────────────── #}
Indexed
{{ status.get("by_status", {}).get("ok", 0) | int }}
files indexed
{% set n_corrupt = status.get("by_status", {}).get("corrupt", 0) | int %} {% set n_unreadable = status.get("by_status", {}).get("unreadable", 0) | int %}
Corrupt
{{ n_corrupt }}
{% if n_corrupt > 0 %} view issues → {% else %} files corrupt {% endif %}
Unreadable
{{ n_unreadable }}
{% if n_unreadable > 0 %} view issues → {% else %} files unreadable {% endif %}
{# ── Active scan (shown while scanning) ────────────────────── #}
Active Scan {% if current_scan %}{{ current_scan.scan_id[:8] }}…{% endif %}
{% if current_scan and current_scan.eta_s %}~{{ (current_scan.eta_s / 60) | round(0, 'ceil') | int }}m remaining{% endif %}
{% if current_scan and current_scan.discovered_total > 0 %} {% set pct = [(current_scan.processed / current_scan.discovered_total * 100) | int, 100] | min %} {% else %} {% set pct = 0 %} {% endif %}
{% if current_scan %} {{ current_scan.processed | default(0) }} / {{ current_scan.discovered_total | default(0) }} {% else %}0 / 0{% endif %} {{ pct }}% {% if current_scan %}{{ "%.1f"|format(current_scan.files_per_sec | default(0)) }} files/sec{% endif %}
{# ── Idle: last scan + setup warnings ─────────────────────── #}
{% set ls = status.get("last_scan") %} {% if ls %}
Last Scan
{% if ls.get("finished_at") %} {% set had_issues = (ls.get("corrupt") or 0) + (ls.get("unreadable") or 0) %} {% if had_issues > 0 %} {{ had_issues }} issue{{ 's' if had_issues != 1 else '' }} {% else %} Clean {% endif %} {% else %} Incomplete {% endif %} {{ ls.get("started_at", "") }}
{{ ls.get("scope") or "all configured paths" }}
{{ ls.get("total", 0) | int }}
files examined
{% if ls.get("files_per_sec") %}
{{ "%.1f"|format(ls.get("files_per_sec")) }} files/sec
{% endif %}
{% else %}
📂
No scans yet
Run your first scan to establish a baseline for this library.
{% endif %} {# Setup warnings #} {% if setup.warnings %}
Setup warnings
    {% for w in setup.warnings %}
  • {{ w }}
  • {% endfor %}
{% endif %}
{% endblock %}