{# Unified jobs fragment with collection-task controls ported from the former scheduler feed (#1318). #} {% from "_macros_ui.html" import empty_state, jobs_filter_qs, task_type_label %} {% macro state_badge(job) %} {% if job.runtime_state == 'running' %}Выполняется {% elif job.runtime_state == 'completed' %}Завершено {% elif job.runtime_state == 'failed' %}Ошибка {% elif job.runtime_state == 'cancelled' %}Отменена {% elif job.runtime_state == 'pause_gate' %}Пауза {% elif job.runtime_state == 'flood_wait' %}Flood wait {% elif job.runtime_state == 'scheduled' %}Запланирована {% elif job.runtime_state == 'inactive' %}Отключена {% else %}Ожидание {% endif %} {% endmacro %} {% set filter_qs = jobs_filter_qs(selected_source, selected_status, page, limit) %}
Все фоновые задачи из единой очереди.
{% if pending_collect_count > 0 %}| Источник | Тип | Описание | Статус | {{ result_column_title }} | Создана | Завершена | Действие |
|---|---|---|---|---|---|---|---|
| {{ job.source }} | {{ task_type_label(job.job_type) }} | {{ job.summary or '—' }} |
{{ state_badge(job) }}
{% if job.note %} {{ job.note }}{% endif %} {% if job.error %} {{ job.error[:100] }}{% endif %} |
{% set pipeline_meta = pipeline_result_meta.get(job.raw_id) if pipeline_result_meta else None %} {% if job.source == 'collection_task' and job.job_type == 'pipeline_run' and pipeline_meta %} {{ pipeline_meta.label }} {{ pipeline_meta.count }} {% if pipeline_meta.errors_count %} ⚠ {{ pipeline_meta.errors_count }} {% endif %} {% elif job.source == 'collection_task' %}{{ job.result_summary or '0' }} {% else %}—{% endif %} | {{ job.created_at|local_dt if job.created_at else '—' }} | {{ job.finished_at|local_dt if job.finished_at else '—' }} | {% if job.source == 'collection_task' and job.status in ['running', 'pending'] %} {% endif %} |