aboutsummaryrefslogtreecommitdiff
path: root/webmentions_ssg/templates/dashboard.html
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--webmentions_ssg/templates/dashboard.html148
1 files changed, 148 insertions, 0 deletions
diff --git a/webmentions_ssg/templates/dashboard.html b/webmentions_ssg/templates/dashboard.html
new file mode 100644
index 0000000..a7f968e
--- /dev/null
+++ b/webmentions_ssg/templates/dashboard.html
@@ -0,0 +1,148 @@
+<!--
+SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
+
+SPDX-License-Identifier: BSD-3-Clause
+-->
+{% extends "base.html" %}
+
+{% block content %}
+ <div class="d-flex justify-content-between align-items-center mb-4">
+ <h1 class="mb-0">Dashboard</h1>
+ <span class="text-body-secondary">Single-site overview</span>
+ </div>
+
+ <div class="row g-4 mb-4">
+ <section class="col-lg-6" aria-labelledby="received-summary">
+ <div class="card h-100">
+ <div class="card-body">
+ <div class="d-flex justify-content-between align-items-center mb-3">
+ <h2 class="h4 mb-0" id="received-summary">Received</h2>
+ <a href="{{ url_for('webmentions.received_list') }}">View all</a>
+ </div>
+ <p class="display-6 mb-3">{{ received_total }} <span class="fs-6 text-body-secondary">total</span></p>
+ <div class="row row-cols-2 g-3">
+ <div class="col">
+ <a href="{{ url_for('webmentions.received_list', status='pending') }}">Pending</a>
+ <div class="h3">{{ received_counts.received }}</div>
+ </div>
+ <div class="col">
+ <a href="{{ url_for('webmentions.received_list', status='verifying') }}">Verifying</a>
+ <div class="h3">{{ received_counts.verifying }}</div>
+ </div>
+ <div class="col">
+ <a href="{{ url_for('webmentions.received_list', status='verified') }}">Verified</a>
+ <div class="h3">{{ received_counts.verified }}</div>
+ </div>
+ <div class="col">
+ <a href="{{ url_for('webmentions.received_list', status='declined') }}">Declined</a>
+ <div class="h3">{{ received_counts.failed + received_counts.source_removed }}</div>
+ <p class="small text-body-secondary mb-0">Failed: {{ received_counts.failed }} ยท Source removed: {{ received_counts.source_removed }}</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+
+ <section class="col-lg-6" aria-labelledby="sent-summary">
+ <div class="card h-100">
+ <div class="card-body">
+ <div class="d-flex justify-content-between align-items-center mb-3">
+ <h2 class="h4 mb-0" id="sent-summary">Outgoing</h2>
+ <a href="{{ url_for('webmentions.source_list') }}">View sources</a>
+ </div>
+ <p class="display-6 mb-3">{{ sent_total }} <span class="fs-6 text-body-secondary">total</span></p>
+ <div class="row row-cols-2 g-3">
+ <div class="col">
+ <div>Sent</div>
+ <div class="h3">{{ sent_counts.sent }}</div>
+ </div>
+ <div class="col">
+ <div>No endpoint</div>
+ <div class="h3">{{ sent_counts.no_endpoint }}</div>
+ </div>
+ <div class="col">
+ <div>Failed (final)</div>
+ <div class="h3">{{ sent_counts.failed }}</div>
+ </div>
+ <div class="col">
+ <div>Not attempted</div>
+ <div class="h3">{{ not_attempted }}</div>
+ </div>
+ <div class="col">
+ <div>Pending</div>
+ <div class="h3">{{ pending_sends }}</div>
+ <p class="small text-body-secondary mb-0">Waiting to retry: {{ waiting_retries }}</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+ </div>
+
+ <section class="mb-4" aria-labelledby="recent-activity">
+ <h2 class="h4" id="recent-activity">Recent activity</h2>
+ <div class="table-responsive">
+ <table class="table table-bordered align-middle">
+ <thead>
+ <tr>
+ <th scope="col">Activity (UTC)</th>
+ <th scope="col">Last 7 days</th>
+ <th scope="col">Last 30 days</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <th scope="row">New received Webmentions</th>
+ <td>{{ recent[7].received }}</td>
+ <td>{{ recent[30].received }}</td>
+ </tr>
+ <tr>
+ <th scope="row">Webmentions last sent successfully</th>
+ <td>{{ recent[7].sent }}</td>
+ <td>{{ recent[30].sent }}</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </section>
+
+ <section aria-labelledby="operations">
+ <h2 class="h4" id="operations">Operations</h2>
+ <div class="row g-3">
+ <div class="col-md-4">
+ <div class="card h-100">
+ <div class="card-body">
+ <h3 class="h6 text-body-secondary">Source documents</h3>
+ <p class="h3 mb-0">{{ source_count }}</p>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="card h-100">
+ <div class="card-body">
+ <h3 class="h6 text-body-secondary">Last completed source scan</h3>
+ {% if last_scan %}
+ <time datetime="{{ last_scan.isoformat() }}" class="fs-5">
+ {{ last_scan.strftime("%Y-%m-%d %H:%M:%S") }} UTC
+ </time>
+ {% else %}
+ <p class="text-body-secondary mb-0">No completed scan yet</p>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="card h-100">
+ <div class="card-body">
+ <h3 class="h6 text-body-secondary">Huey pending tasks</h3>
+ {% if queue_size is not none %}
+ <p class="h3 mb-0">{{ queue_size }}</p>
+ {% else %}
+ <p class="text-body-secondary mb-0">Unavailable</p>
+ {% endif %}
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+{% endblock %}