mastodon-collector/app/templates/index.html
Pieter 1783a48d7c Initial commit: Mastodon collector application
Add Flask-based application for collecting and archiving Mastodon posts from configured accounts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-09 08:05:54 +01:00

123 lines
4.1 KiB
HTML

{% extends "base.html" %}
{% block title %}Dashboard — Mastodon Collector{% endblock %}
{% block content %}
<h1>Dashboard</h1>
<div class="stats-grid">
<div class="stat-card">
<div class="number">{{ total_statuses }}</div>
<div class="label">Total Statuses</div>
</div>
<div class="stat-card">
<div class="number">{{ total_posts }}</div>
<div class="label">Posts</div>
</div>
<div class="stat-card">
<div class="number">{{ total_replies }}</div>
<div class="label">Replies</div>
</div>
<div class="stat-card">
<div class="number">{{ total_mentions }}</div>
<div class="label">Mentions</div>
</div>
<div class="stat-card">
<div class="number">{{ total_reblogs }}</div>
<div class="label">Reblogs</div>
</div>
<div class="stat-card">
<div class="number">{{ account_stats|length }}</div>
<div class="label">Monitored Accounts</div>
</div>
</div>
<div class="card">
<h2>Monitored Accounts</h2>
<table>
<thead>
<tr>
<th>Account</th>
<th>Instance</th>
<th>Status</th>
<th>Collected</th>
<th>Last Run</th>
</tr>
</thead>
<tbody>
{% for item in account_stats %}
<tr>
<td>
<a href="{{ url_for('statuses_list', account_id=item.account.id) }}">
{{ item.account.handle }}
</a>
{% if item.account.display_name %}
<span class="text-muted text-sm">— {{ item.account.display_name }}</span>
{% endif %}
</td>
<td class="text-muted">{{ item.account.instance }}</td>
<td>
{% if item.account.is_active %}
<span class="badge badge-active">Active</span>
{% else %}
<span class="badge badge-paused">Paused</span>
{% endif %}
</td>
<td>{{ item.status_count }}</td>
<td class="text-muted text-sm">
{% if item.account.last_collected_at %}
{{ item.account.last_collected_at.strftime('%Y-%m-%d %H:%M') }}
{% if item.last_log %}
<span class="badge badge-{{ item.last_log.status }}">{{ item.last_log.status }}</span>
{% endif %}
{% else %}
Never
{% endif %}
</td>
</tr>
{% endfor %}
{% if not account_stats %}
<tr>
<td colspan="5" class="text-muted" style="text-align:center; padding: 24px;">
No accounts being monitored yet.
<a href="{{ url_for('accounts_list') }}" style="color: var(--accent);">Add some accounts</a>.
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
{% if recent_logs %}
<div class="card mt-4">
<h2>Recent Collection Runs</h2>
<table>
<thead>
<tr>
<th>Time</th>
<th>Account</th>
<th>Status</th>
<th>Collected</th>
<th>Error</th>
</tr>
</thead>
<tbody>
{% for log in recent_logs %}
<tr>
<td class="text-sm">{{ log.started_at.strftime('%Y-%m-%d %H:%M:%S') if log.started_at }}</td>
<td>
{% if log.account %}
{{ log.account.handle }}
{% else %}
{% endif %}
</td>
<td><span class="badge badge-{{ log.status }}">{{ log.status }}</span></td>
<td>{{ log.statuses_collected }}</td>
<td class="text-muted text-sm truncate">{{ log.error or '—' }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
{% endblock %}