{% extends "base.html" %} {% from "_page_header.html" import page_header %} {% from "_components.html" import badge, identifier, empty_state, pagination, toolbar %} {% block content %} {% call page_header("Ingestion Jobs", "Background processing queue: document ingests and source syncs with their real states, attempts and timing.") %}{% endcall %}

Scope: {{ scope_label }} — counts and rows below cover this scope only. The counters summarise the whole queue in this scope; the table below shows the jobs matching the current filter.

{% if ignored_filters %}

Unrecognised {{ ignored_filters | join(" and ") }} filter{{ "s" if ignored_filters | length > 1 else "" }} ignored; the list below is not narrowed by {{ "them" if ignored_filters | length > 1 else "it" }}.

{% endif %} {% if notice %}

{{ notice }}

{% endif %} {% if not available %} {{ empty_state("Job queue unavailable", "The job store could not be reached. Check PostgreSQL connectivity and retry.", icon="cloud_off") }} {% else %}
{% for key, label in [("queued", "Queued"), ("running", "Running"), ("retrying", "Retrying"), ("succeeded", "Succeeded"), ("failed", "Failed")] %}

{{ label }}

{{ counts[key] }}

{% endfor %}
{% call toolbar("/admin/jobs", label="Filter jobs") %}
{% endcall %} {% if not rows %}
{% if query or page.offset %} {{ empty_state("No jobs match this filter", "No job in this scope matches the selected status and type on this page. Clear the filter to see the whole queue.", "/admin/jobs", "Clear filter", icon="filter_alt_off") }} {% else %} {{ empty_state("No jobs yet", "Upload a document or sync a source to start ingestion; jobs appear here as soon as they are queued.", "/admin/sources", "Go to sources", icon="sync") }} {% endif %}
{% else %}
{% for row in rows %} {% endfor %}
Recent ingestion jobs
Type Source / Document Queued Attempt Status Failure
{{ row.operation_label }}
{{ identifier(row.job.id, "job-" ~ loop.index) }}

{{ row.subject }}

{% if row.source_name %}

{{ row.source_name }}

{% endif %}
{{ row.age }} {{ row.job.attempt_count }} / {{ row.job.max_attempts }} {% if row.status_label == "Succeeded" %}{{ badge(row.status_label, "ok") }} {% elif row.status_label == "Failed" %}{{ badge(row.status_label, "error") }} {% elif row.status_label == "Running" %}{{ badge(row.status_label, "info") }} {% elif row.status_label == "Retrying" %}{{ badge(row.status_label, "warn") }} {% else %}{{ badge(row.status_label, "neutral") }}{% endif %} {{ row.failure_code or row.job.last_error_code or "—" }}
{% endif %} {{ pagination(page.total, page.limit, page.offset, "/admin/jobs", query) }}
{% endif %} {% endblock %}