zcbot/web/templates/home.html

65 lines
2.0 KiB
HTML

{% extends "base.html" %}
{% block title %}zcbot · tasks{% endblock %}
{% block nav %}
<a href="/" class="active">tasks</a>
<a href="/new">new</a>
{% endblock %}
{% block content %}
<div class="page-head">
<h1>tasks <small class="muted">最近 {{ tasks|length }} 条{% if status %} · status={{ status }}{% endif %}</small></h1>
<div class="head-actions">
<form class="filters" method="get" action="/">
<label>status:
<select name="status" onchange="this.form.submit()">
<option value="">all</option>
{% for f in filters %}
<option value="{{ f }}"{% if status == f %} selected{% endif %}>{{ f }}</option>
{% endfor %}
</select>
</label>
{% if status %}<a href="/" class="btn">reset</a>{% endif %}
</form>
<a href="/new" class="btn btn-primary">+ new task</a>
</div>
</div>
{% if not tasks %}
<p class="empty muted">
没有 task{% if status %}(status={{ status }}){% endif %}。
CLI 起一个:<code>cli.py chat --desc "..."</code>;Web 起 task 留到 G6。
</p>
{% else %}
<table class="task-list">
<thead>
<tr>
<th>id</th>
<th>updated</th>
<th>status</th>
<th>mode</th>
<th>model</th>
<th class="num">msgs</th>
<th class="num">tokens</th>
<th>desc / dir</th>
</tr>
</thead>
<tbody>
{% for t in tasks %}
<tr>
<td><a href="/tasks/{{ t.task_id }}" class="task-id" title="{{ t.task_id }}">{{ t.task_id_short }}</a></td>
<td class="muted">{{ t.updated_at.strftime("%m-%d %H:%M") }}</td>
<td><span class="status status-{{ t.status }}">{{ t.status }}</span></td>
<td>{{ t.mode }}</td>
<td class="muted">{{ t.model_label }}</td>
<td class="num">{{ t.n_messages }}</td>
<td class="num">{{ t.tokens }}</td>
<td class="dir">
{% if t.description %}<div class="desc">{{ t.description }}</div>{% endif %}
{% if t.task_dir %}<div class="muted small mono">{{ t.task_dir }}</div>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock %}