feat: project overview + timeline + docs center

- services/task_project_linker.py: task<->project mapping (title keywords + workspace_path)
- routes/pages.py: /timeline, /docs, /docs/<path>, enhanced /projects/<name> and /tasks/<id>
- templates: timeline.html, docs.html, doc_view.html (new), project_detail.html + task_detail.html (overhauled)
- config.py: DOCS_DIRS + ProjectConfig color
- base.html: Timeline + Docs nav links
This commit is contained in:
hermes-dashboard
2026-08-17 20:00:37 +08:00
parent 1e5e30ffcb
commit c0cbd683f4
11 changed files with 813 additions and 16 deletions

View File

@@ -54,14 +54,92 @@
</div>
<div class="card mt-20">
<h3>Recent Commits (last 10)</h3>
{% if project.recent_commits %}
<pre>{% for commit in project.recent_commits %}{{ commit }}
{% endfor %}</pre>
<h3>📋 Task Timeline ({{ tasks|length }} tasks)</h3>
{% if tasks %}
<table>
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Status</th>
<th>Created</th>
<th>Duration</th>
<th>Outcome</th>
</tr>
</thead>
<tbody>
{% for t in tasks %}
<tr>
<td class="text-small"><a href="/tasks/{{ t.task_id }}">{{ t.task_id }}</a></td>
<td>{{ t.title[:80] }}</td>
<td><span class="status-badge status-{{ t.status }}">{{ t.status }}</span></td>
<td class="text-small">{% if t.created_at %}{{ t.created_at|int|dt }}{% endif %}</td>
<td class="text-small">
{% if t.duration_s %}
{% if t.duration_s < 60 %}{{ t.duration_s }}s
{% elif t.duration_s < 3600 %}{{ (t.duration_s / 60)|round(1) }}m
{% else %}{{ (t.duration_s / 3600)|round(1) }}h{% endif %}
{% else %}-{% endif %}
</td>
<td class="text-small text-muted">{{ t.outcome_summary[:80] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-muted">No tasks linked to this project</p>
{% endif %}
</div>
<div class="card mt-20">
<h3>🔀 Recent Commits ({{ commits|length }})</h3>
{% if commits %}
<table>
<thead>
<tr>
<th>Hash</th>
<th>Author</th>
<th>Time</th>
<th>Subject</th>
</tr>
</thead>
<tbody>
{% for c in commits %}
<tr>
<td class="text-small"><a href="{{ c.gitea_url }}" target="_blank">{{ c.short }}</a></td>
<td class="text-small">{{ c.author }}</td>
<td class="text-small">{{ c.ts|int|dt }}</td>
<td>{{ c.subject }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p class="text-muted">No commits found</p>
{% endif %}
</div>
{% if task_files %}
<div class="card mt-20">
<h3>📁 Files Changed (per task time window)</h3>
{% for task_id, commit_files in task_files.items() %}
<div style="margin-bottom:15px;">
<h4 style="margin-bottom:5px;">
<a href="/tasks/{{ task_id }}">{{ task_id }}</a>
</h4>
{% for chash, files in commit_files.items() %}
<div class="text-small" style="margin-left:15px;">
<strong>{{ chash }}</strong>: {{ files|length }} file(s)
<ul style="margin-left:20px;">
{% for f in files[:10] %}<li>{{ f }}</li>{% endfor %}
{% if files|length > 10 %}<li class="text-muted">... {{ files|length - 10 }} more</li>{% endif %}
</ul>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
{% endif %}
{% endif %}
<p class="mt-20">