{% extends "base.html" %} {% block title %}Планировщик — TG Agent{% endblock %} {% block content %}

Планировщик

{% macro task_type_label(t) %} {% if t.task_type.value == 'channel_collect' %}Сбор канала {% elif t.task_type.value == 'stats_all' %}Статистика {% elif t.task_type.value == 'sq_stats' %}Статистика запроса {% elif t.task_type.value == 'photo_due' %}Фото {% elif t.task_type.value == 'photo_auto' %}Автофото {% else %}{{ t.task_type.value }} {% endif %} {% endmacro %}
Планировщик ?
Автоматическое создание задач: сбор каждые {{ interval_minutes }} мин.

Статус: {{ "Запущен" if is_running else "Остановлен" }}

{% if not is_running %}
{% else %}
{% endif %}
{% if search_log %}
Лог поиска ?
{% for entry in search_log %} {% endfor %}
Запрос Аккаунт Результатов Дата
{{ entry.query }} {{ entry.phone }} {{ entry.results_count }} {{ entry.created_at }}
{% for entry in search_log %}
{{ entry.query }} {{ entry.results_count }}
{{ entry.phone }} · {{ entry.created_at }}
{% endfor %}
{% endif %} {% if all_count > 0 %}
Задачи

Все задачи: сбор каналов, статистика, фото.

{% if tasks %}
{% for t in tasks %} {% endfor %}
Тип Канал / Описание Статус Результат Создана Завершена Действие
{{ task_type_label(t) }} {{ t.channel_title or t.channel_id or '—' }} {% if t.channel_username %}
@{{ t.channel_username }} {% endif %}
{% if t.status == 'running' %} Выполняется {% elif t.status == 'completed' %} Завершено {% if t.note %}
{{ t.note }}{% endif %} {% elif t.status == 'failed' %} Ошибка {% if t.error %}
{{ t.error[:100] }}{% endif %} {% elif t.status == 'cancelled' %} Отменена {% else %} {% if t.run_after %} Ожидание до {{ t.run_after.strftime('%Y-%m-%d %H:%M:%S UTC') }} {% else %} Ожидание {% endif %} {% endif %}
{% if t.task_type == 'stats_all' and t.payload and t.payload.channel_ids %} {{ t.messages_collected }}/{{ t.payload.channel_ids|length }} {% else %} {{ t.messages_collected }} {% endif %} {{ t.created_at.strftime('%Y-%m-%d %H:%M') if t.created_at else '—' }} {{ t.completed_at.strftime('%Y-%m-%d %H:%M') if t.completed_at else '—' }} {% if t.status == 'running' %}
{% elif t.status == 'pending' %}
{% endif %}
{% for t in tasks %}
{{ task_type_label(t) }} {{ t.channel_title or t.channel_id or '—' }} {% if t.channel_username %}
@{{ t.channel_username }}{% endif %}
{% if t.status == 'running' %} {% elif t.status == 'completed' %} OK {% elif t.status == 'failed' %} Ошибка {% elif t.status == 'cancelled' %} Отменена {% else %} Ожидание {% endif %}
{% if t.task_type == 'stats_all' and t.payload and t.payload.channel_ids %} {{ t.messages_collected }}/{{ t.payload.channel_ids|length }} {% else %} {{ t.messages_collected }} сообщ. {% endif %} {% if t.created_at %}· {{ t.created_at.strftime('%m-%d %H:%M') }}{% endif %} {% if t.status == 'running' or t.status == 'pending' %}
{% endif %}
{% endfor %}
{% if total_pages > 1 %} {% endif %} {% else %}

Нет задач с выбранным фильтром.

{% endif %}
{% endif %} {% endblock %}