Files
hermes-dashboard/templates/task_detail.html

145 lines
4.9 KiB
HTML

{% extends "base.html" %}
{% block title %}Task #{{ task_id }} - Hermes{% endblock %}
{% block content %}
{% if data.error %}
<h2>Error</h2>
<div class="card">
<p class="text-muted">{{ data.error }}</p>
</div>
{% else %}
{% set task = data.task %}
<h2>📋 Task #{{ task.id }}: {{ task.title }}</h2>
<div class="grid-2">
<div>
<div class="card">
<h3>Task Info</h3>
<p><strong>Status:</strong> <span class="status-badge status-{{ task.status }}">{{ task.status }}</span></p>
<p><strong>Assignee:</strong> {{ task.assignee or 'N/A' }}</p>
<p><strong>Priority:</strong> {{ task.priority or 'N/A' }}</p>
<p><strong>Workspace:</strong> <span class="text-small">{{ task.workspace_path or 'N/A' }}</span></p>
<p><strong>Created:</strong> {% if task.created_at %}{{ task.created_at|int|dt }}{% else %}N/A{% endif %}</p>
{% if task.started_at %}
<p><strong>Started:</strong> {{ task.started_at|int|dt }} ({{ task.started_at|int|rel }})</p>
{% endif %}
{% if task.completed_at %}
<p><strong>Completed:</strong> {{ task.completed_at|int|dt }} ({{ task.completed_at|int|rel }})</p>
{% endif %}
</div>
<div class="card">
<h3>Description</h3>
{% if task.body %}
<pre>{{ task.body[:500] }}</pre>
{% else %}
<p class="text-muted">No description</p>
{% endif %}
</div>
{% if task.result %}
<div class="card">
<h3>Result</h3>
<pre>{{ task.result }}</pre>
</div>
{% endif %}
</div>
<div>
<div class="card">
<h3>Timeline ({{ data.events|length }} events)</h3>
{% if data.events %}
{% for event in data.events %}
<div class="timeline-item">
<div class="timeline-item-header">
{{ event.created_at|int|dt }} - {{ event.kind }}
</div>
<div class="timeline-item-content">
{% if event.payload %}
<pre class="text-small">{{ event.payload }}</pre>
{% endif %}
</div>
</div>
{% endfor %}
{% else %}
<p class="text-muted">No events</p>
{% endif %}
</div>
</div>
</div>
<div class="card mt-20">
<h3>Comments ({{ data.comments|length }})</h3>
{% if data.comments %}
{% for comment in data.comments %}
<div class="comment">
<div class="comment-header">
<strong>{{ comment.author or 'Anonymous' }}</strong> - {{ comment.created_at|int|dt }}
</div>
<div>{{ comment.body }}</div>
</div>
{% endfor %}
{% else %}
<p class="text-muted">No comments</p>
{% endif %}
</div>
<div class="card mt-20">
<h3>Runs ({{ data.runs|length }})</h3>
{% if data.runs %}
<table>
<thead>
<tr>
<th>ID</th>
<th>Profile</th>
<th>Status</th>
<th>PID</th>
<th>Started</th>
<th>Ended</th>
<th>Outcome</th>
</tr>
</thead>
<tbody>
{% for run in data.runs %}
<tr>
<td>{{ run.id }}</td>
<td>{{ run.profile or 'N/A' }}</td>
<td><span class="status-badge status-{{ run.status }}">{{ run.status }}</span></td>
<td>{{ run.worker_pid or 'N/A' }}</td>
<td>{% if run.started_at %}{{ run.started_at|int|dt }}{% else %}N/A{% endif %}</td>
<td>{% if run.ended_at %}{{ run.ended_at|int|dt }}{% else %}N/A{% endif %}</td>
<td>{{ run.outcome or 'N/A' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-muted">No runs</p>
{% endif %}
</div>
<div class="card mt-20">
<h3>Attachments ({{ data.attachments|length }})</h3>
{% if data.attachments %}
<ul class="attachment-list">
{% for attachment in data.attachments %}
<li>
<strong>{{ attachment.filename }}</strong>
<span class="text-muted">({{ attachment.content_type }}, {{ attachment.size }} bytes)</span>
<br>
<span class="text-small">Uploaded by {{ attachment.uploaded_by or 'unknown' }} on {{ attachment.created_at|int|dt }}</span>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-muted">No attachments</p>
{% endif %}
</div>
{% endif %}
<p class="mt-20">
<a href="/tasks" class="btn">← Back to Tasks</a>
</p>
{% endblock %}