{% extends "base.html" %} {% block title %}任务监控 — HF Daily Papers{% endblock %} {% set type_label = {"crawl_daily":"抓取","pipeline_daily":"流水线","summarize_batch":"批量总结","summarize_one":"单篇总结","refresh_upvotes":"刷新投票","delete_range":"删除","cleanup_tmp":"清理","reindex_fts":"重建全文","reindex_chroma":"重建语义","recrawl_one":"重抓","recrawl_batch":"批量重抓"} %} {% set type_badge = {"crawl_daily":"task-crawl","pipeline_daily":"task-crawl","recrawl_one":"task-crawl","recrawl_batch":"task-crawl","refresh_upvotes":"task-crawl","summarize_batch":"task-summarize","summarize_one":"task-summarize","cleanup_tmp":"task-cleanup","delete_range":"task-delete","reindex_fts":"task-reindex","reindex_chroma":"task-reindex"} %} {% set status_label = {"queued":"排队","running":"运行中","success":"成功","failed":"失败","stale":"已过期","cancelled":"已取消"} %} {% set status_badge = {"queued":"status-queued","running":"status-running","success":"status-success","failed":"status-failed","stale":"status-stale","cancelled":"status-stale"} %} {% macro fmt_duration(s) -%} {%- if s is none %}- {%- elif s < 60 %}{{ "%.0f"|format(s) }}s {%- elif s < 3600 %}{{ (s // 60)|int }}m {{ (s % 60)|round|int }}s {%- else %}{{ (s // 3600)|int }}h {{ ((s % 3600) // 60)|int }}m {%- endif -%} {%- endmacro %} {% block content %}
{% set active = "jobs" %}{% include "partials/admin_subnav.html" %}

🧰 任务监控

{% set _total = (status_counts.values() | sum) if status_counts else 0 %}
总计 {{ _total }} 排队 {{ status_counts.get('queued', 0) }} 运行中 {{ status_counts.get('running', 0) }} 成功 {{ status_counts.get('success', 0) }} 失败 {{ status_counts.get('failed', 0) + status_counts.get('stale', 0) }}
{% set statuses = [("all","全部"),("queued","排队"),("running","运行中"),("success","成功"),("failed","失败"),("stale","已过期")] %}
状态: {% for key, label in statuses %} {{ label }} ({% if key == 'all' %}{{ _total }}{% else %}{{ status_counts.get(key, 0) }}{% endif %}) {% endfor %}
{% set types = [("crawl_daily","抓取"),("pipeline_daily","流水线"),("summarize_batch","批量总结"),("summarize_one","单篇总结"),("refresh_upvotes","刷新投票"),("recrawl_one","重抓"),("recrawl_batch","批量重抓"),("delete_range","删除"),("cleanup_tmp","清理"),("reindex_fts","重建全文"),("reindex_chroma","重建语义")] %}
类型:
{% if jobs %}
{% for job in jobs %} {% endfor %}
ID类型状态触发者创建时间耗时操作
{{ job.id }} {{ type_label.get(job.type, job.type) }} {{ status_label.get(job.status, job.status) }} {{ job.owner or '-' }} {{ job.created_at.strftime('%Y-%m-%d %H:%M:%S') if job.created_at else '-' }} {{ fmt_duration(job.duration_seconds) }}
{% set total_pages = ((total + per_page - 1) // per_page) if total else 1 %} {% if total_pages > 1 %} {% endif %} {% else %}

暂无任务记录

触发抓取、总结等操作后,任务会出现在这里。可在「详情」中查看阶段事件。

{% endif %}
{% endblock %} {% block scripts %} {% endblock %}