bifroest/app/templates/runs.html
2026-10-27 08:34:17 +01:00

41 lines
2.8 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% block title %}Runs{% endblock %}
{% block content %}
<div class="stack stack-sm">
<h1>Runs{% if workspace %}: {{ workspace.name }}{% endif %}</h1>
<p class="text-muted">Jede Chat-Antwort und jeder erneut beantragte Vorschlag läuft als Run im Worker. Gezeigt werden die letzten 200 Runs im Zeitraum, neueste zuerst, mit Status, Dauer und Verbrauch.</p>
</div>
<section class="card"><div class="card-body stack">
<form method="get" class="cluster aiw-filters">
<label class="text-sm">Zeitraum
<select name="period">{% for k, v in periods.items() %}<option value="{{ k }}" {% if period == k %}selected{% endif %}>{{ v }}</option>{% endfor %}</select>
</label>
<label class="text-sm">von <input type="date" name="start" value="{{ start }}"></label>
<label class="text-sm">bis <input type="date" name="end" value="{{ end }}"></label>
<label class="text-sm">Status
<select name="status"><option value="">alle</option>{% for k, v in labels.items() %}<option value="{{ k }}" {% if status == k %}selected{% endif %}>{{ v }}</option>{% endfor %}</select>
</label>
<button class="btn btn-secondary btn-sm" type="submit">Anzeigen</button>
</form>
{% if rows %}
<div class="table-wrap"><table>
<thead><tr><th>Gestartet</th>{% if not workspace %}<th>Workspace</th>{% endif %}<th>Von</th><th>Art</th><th>Status</th><th class="aiw-number">Dauer</th><th class="aiw-number">Tokens</th><th class="aiw-number">Kosten ({{ currency }})</th></tr></thead>
<tbody>
{% for row in rows %}{% set r = row.run %}
<tr>
<td class="text-sm aiw-nowrap">{% if r.chat_session_id %}<a href="/chats/{{ r.chat_session_id }}">{{ r.created.strftime('%d.%m.%Y %H:%M') }}</a>{% else %}{{ r.created.strftime('%d.%m.%Y %H:%M') }}{% endif %}</td>
{% if not workspace %}<td class="text-sm">{{ row.workspace }}</td>{% endif %}
<td class="text-sm">{{ row.user }}</td>
<td class="text-sm">{{ r.kind }}{% if r.attempts > 1 %}<p class="text-xs text-muted">{{ r.attempts }} Versuche</p>{% endif %}</td>
<td><span class="badge {{ 'badge-success' if r.status == 'completed' else 'badge-danger' if r.status in ('failed', 'blocked_by_guardrail', 'needs_reconciliation') else 'badge-warning' if r.status in ('waiting_approval', 'running', 'queued') else 'badge-default' }}">{{ labels.get(r.status, r.status) }}</span>
{% if r.error %}<p class="text-xs text-muted aiw-break">{{ r.error[:200] }}</p>{% endif %}</td>
<td class="aiw-number text-sm">{% if row.duration is not none %}{{ '%.1f'|format(row.duration) }} s{% else %}–{% endif %}</td>
<td class="aiw-number text-sm">{{ row.tokens|number }}</td>
<td class="aiw-number text-sm">{{ row.cost|money }}</td>
</tr>
{% endfor %}
</tbody>
</table></div>
{% else %}<p class="text-muted">Keine Runs im Zeitraum.</p>{% endif %}
</div></section>
{% endblock %}