49 lines
2.5 KiB
HTML
49 lines
2.5 KiB
HTML
{% for task in tasks %}
|
|
{% set status_label, status_class = status_badge_config(task.status) %}
|
|
{% set percent = progress_percent(task.processed_items_count, task.total_items_count) %}
|
|
{% set ai_percent = rate_percent(task.analysis_success_rate) %}
|
|
<tr>
|
|
<td>
|
|
<code>{{ task.id }}</code>
|
|
{% if task.is_demo %}
|
|
<br><span class="badge text-bg-info">Demo 数据</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ task.platform | platform_label }}</td>
|
|
<td>{{ task.created_at }}</td>
|
|
<td><small class="text-muted">热点 {{ task.hotspot_limit }} / 内容 {{ task.item_limit_per_hotspot }} / 评论 {{ task.comment_limit_per_item }}</small></td>
|
|
<td class="task-progress-cell">
|
|
<div class="d-flex justify-content-between align-items-center gap-2">
|
|
<span class="small">已处理 {{ task.processed_items_count }} / 共 {{ task.total_items_count }} 条内容</span>
|
|
<span class="small text-muted">{{ percent }}%</span>
|
|
</div>
|
|
<div class="progress task-progress mt-1" role="progressbar" aria-label="任务进度" aria-valuenow="{{ percent }}" aria-valuemin="0" aria-valuemax="100">
|
|
<div class="progress-bar" style="width: {{ percent }}%"></div>
|
|
</div>
|
|
<div class="small text-muted mt-1">成功 {{ task.successful_items_count }} / 失败 {{ task.failed_items_count }}</div>
|
|
<div class="small text-muted mt-1">阶段:{{ task.current_stage_label or "等待启动" }}</div>
|
|
<div class="small text-muted mt-1">评论 {{ task.comments_count or 0 }} / 报告 {{ task.reports_count or 0 }}</div>
|
|
<div class="small {% if task.analysis_status == 'insufficient' %}text-warning{% else %}text-muted{% endif %}">
|
|
AI 成功率 {{ ai_percent }}%
|
|
{% if task.analysis_status == "insufficient" %}
|
|
<span class="badge text-bg-warning ms-1">AI 样本不足</span>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<span class="badge {{ status_class }}">{{ status_label }}</span>
|
|
{% if task.error_stage or task.error_type %}
|
|
<br><small class="text-muted">{{ task.error_stage }} / {{ task.error_type }}</small>
|
|
{% endif %}
|
|
{% if task.error_message %}
|
|
<br><small class="text-danger">{{ task.error_message }}</small>
|
|
{% endif %}
|
|
</td>
|
|
<td><a class="btn btn-sm btn-outline-primary" href="/tasks/{{ task.id }}">查看</a></td>
|
|
</tr>
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="7" class="text-center text-muted py-4">还没有任何任务,请在上方创建第一个任务</td>
|
|
</tr>
|
|
{% endfor %}
|