{# 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 %}
{% endif %} {% if has_active_tasks %} {% endif %}
{% if jobs %}
{% for job in jobs %} {% endfor %}
ИсточникТипОписаниеСтатус {{ 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 %}
{% for job in jobs %}
{{ task_type_label(job.job_type) }} {{ job.summary or '—' }}
{{ job.source }}
{{ state_badge(job) }}
{% 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' }} {% endif %} {% if job.created_at %}· {{ job.created_at|local_dt }}{% endif %} {% if job.error %}
{{ job.error[:100] }}
{% endif %} {% if job.source == 'collection_task' and job.status in ['running', 'pending'] %}
{% endif %}
{% endfor %}
{% if total_pages > 1 %} {% endif %} {% else %}
{{ empty_state("Нет задач с выбранным фильтром.") }}
{% endif %}
{% if has_active_tasks %}
{% endif %}