{% if tasks %}
{{ tasks|length }}
总任务数
{{ tasks|selectattr('task.is_active')|list|length }}
运行中
{{ tasks|selectattr('last_run')|selectattr('last_run.status', 'equalto', 'success')|list|length }}
成功运行
{{ tasks|selectattr('last_run')|selectattr('last_run.status', 'equalto', 'failed')|list|length }}
失败运行
所有任务
{% for item in tasks %} {% endfor %}
任务ID 描述 触发类型 配置 状态 最后运行 运行状态 操作
{{ item.task.task_id }}
{{ item.task.description or '-' }}
{% if item.task.trigger_type == 'interval' %} 间隔 {% else %} Crontab {% endif %} {% if item.task.trigger_type == 'interval' %} {{ item.task.interval_seconds }}秒 {% else %} {{ item.task.cron_expression }} {% endif %} {% if item.task.is_active %} 启用 {% else %} 禁用 {% endif %} {% if item.last_run %} {{ item.last_run.created_at | local_time }} {% else %} - {% endif %} {% if item.last_run %} {% if item.last_run.status == 'success' %} 成功 {% elif item.last_run.status == 'failed' %} 失败 {% elif item.last_run.status == 'running' %} 运行中 {% elif item.last_run.status == 'pending' %} 等待 {% elif item.last_run.status == 'skipped' %} 跳过 {% endif %} {% else %} - {% endif %}
详情 {% if item.task.is_active %} {% else %} {% endif %}
{% else %}

暂无任务

使用 @task 装饰器定义您的任务

{% endif %}