Files
photo-pipeline/dashboard/templates/pipeline.html

74 lines
2.8 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pipeline — photo-pipeline</title>
<meta http-equiv="refresh" content="30">
<style>
:root { color-scheme: dark; }
body { font-family: system-ui, sans-serif; margin: 0; background: #111; color: #eee; }
header { padding: 1rem 1.5rem; border-bottom: 1px solid #333; display: flex; gap: 1.5rem; align-items: baseline; }
header h1 { font-size: 1.2rem; margin: 0; }
header a { color: #6cf; text-decoration: none; }
main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }
h2 { font-size: 1.1rem; margin-top: 2rem; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid #222; }
th { color: #999; font-size: .8rem; text-transform: uppercase; }
.badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .75rem; }
.badge.completed { background: #1d4; color: #031; }
.badge.crashed, .badge.failed { background: #d43; color: #fff; }
.badge.scheduled { background: #44a; color: #fff; }
.badge.running { background: #4a4; color: #fff; }
.badge.approved { background: #1d4; color: #031; }
.badge.rejected { background: #d43; color: #fff; }
.badge.cancelled { background: #666; }
.badge.unknown { background: #333; }
.auto { color: #666; font-size: .8rem; text-align: right; margin-top: 2rem; }
</style>
</head>
<body>
<header>
<h1>📸 photo-pipeline</h1>
<a href="/">Overview</a>
<a href="/review">Review queue</a>
<a href="/pipeline">Pipeline</a>
<a href="/review?status=approved">Approved</a>
</header>
<main>
<h2>Recent flow runs (Prefect)</h2>
<table>
<tr><th>Flow</th><th>State</th><th>Run</th><th>Started</th><th>Duration</th></tr>
{% for r in runs %}
<tr>
<td>{{ r["flow"] }}</td>
<td><span class="badge {{ r["state"]|lower }}">{{ r["state"] }}</span></td>
<td style="color:#aaa">{{ r["name"] }}</td>
<td>{{ r["start"] }}</td>
<td>{{ r["duration"] }}</td>
</tr>
{% else %}
<tr><td colspan="5" style="color:#666;font-style:italic">No flow runs yet</td></tr>
{% endfor %}
</table>
<h2>Recent review actions</h2>
<table>
<tr><th>File</th><th>Decision</th><th>Source</th><th>When</th></tr>
{% for a in actions %}
<tr>
<td>{{ a["name"] }}</td>
<td><span class="badge {{ a["status"] }}">{{ a["status"] }}</span></td>
<td>{{ a["source"] }}</td>
<td>{{ a["when"] }}</td>
</tr>
{% else %}
<tr><td colspan="4" style="color:#666;font-style:italic">No review actions yet — decisions you make appear here</td></tr>
{% endfor %}
</table>
<p class="auto">Auto-refreshes every 30s.</p>
</main>
</body>
</html>