Files
alembic/app/templates/jobs/index.html
T
andrew c87ddc2649 Dashboard detail, library filtering/pagination, simplified playlist times,
job descriptions

Dashboard: format breakdown (FLAC/MP3/etc. counts), approximate library
size (bitrate*length/8, same approximation `beet stats` itself uses --
verified to match its "100.5 GiB" output exactly against the real
library), and a credential auth-state summary per scope (configured y/n
plus, for Bandcamp, cookie expiry parsed locally from the stored cookie
jar -- deliberately not a live network probe like pipeline-status.sh's
Qobuz check, since this renders on every dashboard load).

Library: was one unfiltered page dumping all 4072 tracks. Added search
(artist/title/album), playlist and format filter dropdowns, and real
SQL-level pagination (LIMIT/OFFSET, not fetch-everything-then-slice).
beets_service gained count_items()/distinct_formats() to support this.

Playlists: cron_expr is still the stored/scheduled representation, but the
UI now shows and edits a plain daily time picker instead of raw cron
syntax -- every playlist schedule today is a simple daily HH:MM anyway.
playlist_service.cron_to_time()/time_to_cron() convert at the router
boundary; verified round-trip against all real playlist cron values.

Jobs: each maintenance job now shows a short one-line description of what
it actually does (MAINTENANCE_JOB_DESCRIPTIONS), and "next run" is
formatted consistently with playlists' time style (HH:MM, with a day
qualifier for non-today runs -- maintenance jobs can be weekly/monthly,
unlike playlists' plain daily schedule).

Verified end-to-end against the real production data (4072 tracks, 100.5
GiB, real credentials): stats/format-breakdown/search/pagination all
correct, all 7 credential scopes report configured with Bandcamp's real
cookie expiry (325 days), and a full authenticated page-render sweep
(dashboard, library with every filter combination, playlist detail,
jobs) all returned 200 with no template errors.
2026-07-08 15:39:22 -06:00

49 lines
1.8 KiB
HTML

{% extends "base.html" %}
{% block title %}Jobs — alembic{% endblock %}
{% block content %}
<div class="page-header">
<div>
<h1>Jobs</h1>
<p class="subtitle muted">Maintenance runs on their own schedule, or trigger them manually here.</p>
</div>
</div>
<h2>Maintenance jobs</h2>
<div class="table-wrap scroll">
<table>
<thead><tr><th>Job</th><th>Status</th><th>Next run</th><th></th></tr></thead>
<tbody>
{% for job in maintenance_jobs %}
<tr>
<td>
<div class="mono">{{ job.job_key }}</div>
{% if job.description %}<div class="muted" style="font-size:0.8em; margin-top:0.15rem;" title="{{ job.description }}">{{ job.description }}</div>{% endif %}
</td>
<td>{% if job.enabled %}<span class="badge badge-success">enabled</span>{% else %}<span class="badge badge-muted">disabled</span>{% endif %}</td>
<td class="muted mono">{{ job.next_run }}</td>
<td class="actions-cell">
<form method="post" action="/jobs/{{ job.job_key }}/run" class="inline">
<button type="submit" class="btn btn-sm">Run now</button>
</form>
<form method="post" action="/jobs/{{ job.job_key }}/toggle" class="inline">
<button type="submit" class="btn btn-sm btn-ghost">{{ "Disable" if job.enabled else "Enable" }}</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<p class="muted">Playlist syncs are triggered from each playlist's own page.</p>
<h2>Recent runs</h2>
<div class="table-wrap scroll">
<table>
<thead><tr><th>Job</th><th>Status</th><th>Triggered by</th><th>Summary</th><th></th></tr></thead>
<tbody id="runs-tbody" hx-get="/jobs/_runs_table" hx-trigger="every 5s" hx-swap="innerHTML">
{% include "jobs/_runs_table.html" %}
</tbody>
</table>
</div>
{% endblock %}