{% extends "base.html" %}
{% block title %}Fissue · 看板{% endblock %}
{% block content %}
<section class="cards">
  <div class="card"><div class="num">{{ total }}</div><div class="label">条目总数</div></div>
  <div class="card"><div class="num">{{ usage_calls }}</div><div class="label">今日模型调用</div></div>
  <div class="card"><div class="num">{{ usage_cost }}</div><div class="label">今日成本</div></div>
</section>

<h2>队列</h2>
<table>
  <thead><tr><th>队列</th><th>待处理</th><th>执行中</th><th>待定论</th></tr></thead>
  <tbody>
  {% for queue in queues %}
    <tr><td>{{ queue.name }}</td><td>{{ queue.pending }}</td><td>{{ queue.running }}</td><td>{{ queue.unflushed }}</td></tr>
  {% endfor %}
  </tbody>
</table>

<h2>需要你处理的</h2>
{% if stuck.is_empty() %}
  <p class="muted">暂时没有需要人工介入的条目。</p>
{% else %}
<table>
  <thead><tr><th>条目</th><th>状态</th><th>分类</th><th>优先级</th><th>标签</th></tr></thead>
  <tbody>
  {% for item in stuck %}
    <tr>
      <td><a href="/item?key={{ item.key }}">{{ item.title }}</a><div class="muted">{{ item.repo }} #{{ item.number }}</div></td>
      <td>{{ item.status }}</td><td>{{ item.category }}</td><td>{{ item.priority }}</td><td>{{ item.labels }}</td>
    </tr>
  {% endfor %}
  </tbody>
</table>
{% endif %}

<h2>状态分布</h2>
<table>
  <thead><tr><th>状态</th><th>数量</th></tr></thead>
  <tbody>
  {% for pair in by_status %}
    <tr><td>{{ pair.0 }}</td><td>{{ pair.1 }}</td></tr>
  {% endfor %}
  </tbody>
</table>
{% endblock %}