{% extends "admin/base_site.html" %} {% load static %} {% block title %}爬虫状态 - {{ site_title|default:_('Django site admin') }}{% endblock %} {% block extrastyle %} {% endblock %} {% block content %}

爬虫状态监控

{{ task_stats.total_nodes }}
活跃节点
{{ task_stats.active_tasks }}
运行中任务
{{ task_stats.total_batches }}
总批次
{{ nodes|length }}
在线节点

爬虫节点状态

{% if nodes %} {% for node in nodes %}
{{ node.node_id }} {{ node.status }}
活跃任务: {{ node.active_tasks }}
完成任务: {{ node.completed_tasks }}
失败任务: {{ node.failed_tasks }}
最后心跳: {% if node.last_heartbeat %} {{ node.last_heartbeat|date:"H:i:s" }} {% else %} 未知 {% endif %}
{% endfor %} {% else %}
暂无活跃的爬虫节点
{% endif %}

最近批次

{% if batches %} {% for batch in batches %}
{{ batch.batch_id }} {% if batch.status == 'running' %} 运行中 {% elif batch.status == 'completed' %} 已完成 {% elif batch.status == 'failed' %} 失败 {% else %} {{ batch.status }} {% endif %}
总任务: {{ batch.total_tasks }}
已完成: {{ batch.completed_tasks }}
失败: {{ batch.failed_tasks }}
进度: {{ batch.progress|floatformat:1 }}%
{% if batch.status == 'running' %}
{% endif %}
{% endfor %} {% else %}
暂无批次记录
{% endif %}
{% endblock %}