Restructure Settings nav, modernize import page, dedup/genres UX polish
Settings is now one top-nav entry with Credentials and Jobs as sidebar sub-pages (jobs moved from /jobs to /settings/jobs). Manual import page replaces the bare file input and free-text filename field with a drag-drop dropzone and a proper file-picker table. Genres page drops the "force" checkbox for two explicit buttons (Preview / Fix genres now). Dedup's "Scan now" runs both the file-naming and acoustic passes together, and the table labels which pass caught each candidate instead of showing the raw pass name. .btn-ghost gets a visible border so it reads as a real button next to Delete/Danger actions instead of looking unaligned. Job names throughout the UI are now human-readable instead of raw job_key strings. Also includes the fpcalc exit-code fix from earlier (fingerprint index was discarding valid fingerprints on files with a benign decode warning).
This commit is contained in:
@@ -42,11 +42,10 @@
|
||||
<a href="/" class="{{ 'active' if request.url.path == '/' else '' }}">Dashboard</a>
|
||||
<a href="/playlists" class="{{ 'active' if request.url.path.startswith('/playlists') else '' }}">Playlists</a>
|
||||
<a href="/library" class="{{ 'active' if request.url.path.startswith('/library') else '' }}">Library</a>
|
||||
<a href="/jobs" class="{{ 'active' if request.url.path.startswith('/jobs') else '' }}">Jobs</a>
|
||||
<a href="/dedup" class="{{ 'active' if request.url.path.startswith('/dedup') else '' }}">Dedup</a>
|
||||
<a href="/genres" class="{{ 'active' if request.url.path.startswith('/genres') else '' }}">Genres</a>
|
||||
<a href="/import" class="{{ 'active' if request.url.path.startswith('/import') else '' }}">Import</a>
|
||||
<a href="/settings/credentials" class="{{ 'active' if request.url.path.startswith('/settings/credentials') else '' }}">Credentials</a>
|
||||
<a href="/settings/credentials" class="{{ 'active' if request.url.path.startswith('/settings') else '' }}">Settings</a>
|
||||
</nav>
|
||||
{% if user %}
|
||||
<div class="user-chip">
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Credentials — alembic{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1>Credentials</h1>
|
||||
<p class="subtitle muted">Write-only: values are encrypted at rest and never sent back to the browser. Leave a field blank to keep it unchanged.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% extends "settings/_layout.html" %}
|
||||
{% block settings_title %}Credentials{% endblock %}
|
||||
{% block settings_content %}
|
||||
<h2 style="margin-top:0;">Credentials</h2>
|
||||
<p class="muted" style="margin-top:-0.75rem;">Write-only: values are encrypted at rest and never sent back to the browser. Leave a field blank to keep it unchanged.</p>
|
||||
|
||||
<div class="cred-grid">
|
||||
{% for scope, fields in scope_fields.items() %}
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
{% set status_badge = {"running": "badge-info badge-pulse", "success": "badge-success", "failed": "badge-danger", "skipped_lock": "badge-muted"} %}
|
||||
{% for run in recent_runs %}
|
||||
<tr>
|
||||
<td>{{ run.job_key }}</td>
|
||||
<td>{{ humanize_job_key(run.job_key) }}</td>
|
||||
<td><span class="badge {{ status_badge.get(run.status, 'badge-muted') }}">{{ run.status }}</span></td>
|
||||
<td class="muted">{{ run.triggered_by }}</td>
|
||||
<td>{{ run.summary or "—" }}</td>
|
||||
@@ -87,5 +87,5 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p><a href="/jobs">See all jobs →</a></p>
|
||||
<p><a href="/settings/jobs">See all jobs →</a></p>
|
||||
{% endblock %}
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
</div>
|
||||
<div class="actions">
|
||||
<form method="post" action="/dedup/scan" class="inline">
|
||||
<button type="submit" class="btn btn-primary" title="Tag-based: matches on artist/title/albumartist across 4 passes">Scan now</button>
|
||||
</form>
|
||||
<form method="post" action="/dedup/scan-fuzzy" class="inline">
|
||||
<button type="submit" class="btn" title="Acoustic fingerprint match -- catches the same recording filed under different tags">Scan for audio duplicates</button>
|
||||
<button type="submit" class="btn btn-primary" title="Checks both filenames/tags and acoustic fingerprints">Scan now</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@@ -22,17 +19,18 @@
|
||||
<div class="table-wrap scroll">
|
||||
<table class="dedup-table">
|
||||
<colgroup>
|
||||
<col style="width:2.2rem"><col style="width:7rem"><col style="width:30%">
|
||||
<col style="width:30%"><col style="width:5rem"><col style="width:9rem">
|
||||
<col style="width:2.2rem"><col style="width:9.5rem"><col style="width:28%">
|
||||
<col style="width:28%"><col style="width:5rem"><col style="width:9rem">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr><th></th><th>Pass</th><th>Keep</th><th>Delete</th><th>Size</th><th>Action</th></tr>
|
||||
<tr><th></th><th>Caught by</th><th>Keep</th><th>Delete</th><th>Size</th><th>Action</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set pass_badge = {"File Naming": "badge-info", "Acoustically Similar": "badge-warning"} %}
|
||||
{% for c in candidates %}
|
||||
<tr>
|
||||
<td><input type="checkbox" name="candidate_id" value="{{ c.id }}" form="bulk-delete-form"></td>
|
||||
<td><span class="badge badge-info">{{ c.pass_name }}</span></td>
|
||||
<td><span class="badge {{ pass_badge.get(c.pass_label, 'badge-info') }}" title="{{ c.pass_name }}">{{ c.pass_label }}</span></td>
|
||||
<td class="muted mono path-cell" title="{{ c.keep_path }}">{{ c.keep_display }}</td>
|
||||
<td class="mono path-cell" title="{{ c.delete_path }}">{{ c.delete_display }}</td>
|
||||
<td class="muted">{{ (c.delete_size_bytes / 1024 / 1024) | round(1) if c.delete_size_bytes else '?' }} MB</td>
|
||||
@@ -68,16 +66,16 @@
|
||||
<div class="table-wrap scroll">
|
||||
<table class="dedup-table">
|
||||
<colgroup>
|
||||
<col style="width:7rem"><col style="width:34%">
|
||||
<col style="width:34%"><col style="width:5rem"><col style="width:7rem">
|
||||
<col style="width:9.5rem"><col style="width:33%">
|
||||
<col style="width:33%"><col style="width:5rem"><col style="width:7rem">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr><th>Pass</th><th>Keep</th><th>Delete</th><th>Size</th><th></th></tr>
|
||||
<tr><th>Caught by</th><th>Keep</th><th>Delete</th><th>Size</th><th></th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for c in ignored %}
|
||||
<tr>
|
||||
<td><span class="badge badge-muted">{{ c.pass_name }}</span></td>
|
||||
<td><span class="badge badge-muted" title="{{ c.pass_name }}">{{ c.pass_label }}</span></td>
|
||||
<td class="muted mono path-cell" title="{{ c.keep_path }}">{{ c.keep_display }}</td>
|
||||
<td class="muted mono path-cell" title="{{ c.delete_path }}">{{ c.delete_display }}</td>
|
||||
<td class="muted">{{ (c.delete_size_bytes / 1024 / 1024) | round(1) if c.delete_size_bytes else '?' }} MB</td>
|
||||
|
||||
@@ -9,10 +9,15 @@
|
||||
</div>
|
||||
|
||||
<div class="panel" style="max-width:560px;">
|
||||
<form method="post" action="/genres/scan">
|
||||
<label class="checkbox-field"><input type="checkbox" name="force" value="true"> Force (overwrite existing genres)</label>
|
||||
<button type="submit" class="btn btn-primary">Preview now (dry run)</button>
|
||||
</form>
|
||||
<p class="muted" style="margin-top:0;">Preview shows what would change, including overwriting existing genres. Fix writes those changes for real.</p>
|
||||
<div class="btn-row">
|
||||
<form method="post" action="/genres/scan" class="inline">
|
||||
<button type="submit" class="btn btn-ghost">Preview changes</button>
|
||||
</form>
|
||||
<form method="post" action="/genres/apply" class="inline">
|
||||
<button type="submit" class="btn btn-primary">Fix genres now</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Last run</h2>
|
||||
|
||||
@@ -4,60 +4,74 @@
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1>Manual import</h1>
|
||||
<p class="subtitle muted">Drop files into <span class="mono">import-me/</span> and run them through the pipeline.</p>
|
||||
<p class="subtitle muted">For anything outside the normal playlist flow: a stray download, a one-off track, a Bandcamp leftover.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if request.query_params.get('run_id') %}
|
||||
<div class="notice success">Import job started (run id {{ request.query_params.get('run_id') }}). Check the Jobs page for progress.</div>
|
||||
<div class="notice success">Import started (run #{{ request.query_params.get('run_id') }}). Check <a href="/settings/jobs">Jobs</a> for progress.</div>
|
||||
{% endif %}
|
||||
|
||||
<h2>Upload a file into import-me/</h2>
|
||||
<div class="panel" style="max-width:560px;">
|
||||
<form method="post" action="/import/upload" enctype="multipart/form-data">
|
||||
<div class="field wide">
|
||||
<input type="file" name="file" required>
|
||||
</div>
|
||||
<button type="submit" class="btn">Upload</button>
|
||||
<div class="panel dropzone-panel" x-data="{ over: false }">
|
||||
<form method="post" action="/import/upload" enctype="multipart/form-data" x-ref="uploadForm">
|
||||
<label class="dropzone" :class="{ dragover: over }"
|
||||
@dragover.prevent="over = true"
|
||||
@dragleave.prevent="over = false"
|
||||
@drop.prevent="over = false">
|
||||
<svg class="dropzone-icon" width="30" height="30" viewBox="0 0 24 24" fill="none">
|
||||
<path d="M12 15V4M12 4l-4 4M12 4l4 4" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
<path d="M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</svg>
|
||||
<span class="dropzone-title">Drop a file here, or click to browse</span>
|
||||
<span class="dropzone-hint">Goes straight into import-me/</span>
|
||||
<input type="file" name="file" required @change="$refs.uploadForm.submit()">
|
||||
</label>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h2>Contents of import-me/</h2>
|
||||
{% if contents %}
|
||||
<ul class="chip-list">
|
||||
{% for name in contents %}
|
||||
<li>{{ name }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% else %}
|
||||
<p class="muted">(empty)</p>
|
||||
{% endif %}
|
||||
|
||||
<h2>Run import</h2>
|
||||
<div class="panel" style="max-width:560px;">
|
||||
<form method="post" action="/import/run">
|
||||
<div class="field">
|
||||
<label for="source">File/subdir</label>
|
||||
<input type="text" id="source" name="source" list="import-contents">
|
||||
<span class="hint">Blank = import everything above.</span>
|
||||
<datalist id="import-contents">
|
||||
{% for name in contents %}
|
||||
<option value="{{ name }}">
|
||||
{% endfor %}
|
||||
</datalist>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="playlist_name">Playlist tag (optional)</label>
|
||||
<select id="playlist_name" name="playlist_name">
|
||||
<option value="">(none)</option>
|
||||
<div class="page-header" style="margin-top:2.5rem; margin-bottom:1rem;">
|
||||
<div>
|
||||
<h2 style="margin:0;">Waiting to import</h2>
|
||||
<p class="subtitle muted">{{ contents | length }} item{{ "s" if contents | length != 1 else "" }} in import-me/.</p>
|
||||
</div>
|
||||
{% if contents %}
|
||||
<div class="actions">
|
||||
<form method="post" action="/import/run" class="inline" style="display:flex; gap:0.6rem; align-items:center;">
|
||||
<select name="playlist_name" title="Playlist tag (optional)" style="width:auto;">
|
||||
<option value="">No playlist tag</option>
|
||||
{% for p in playlists %}
|
||||
<option value="{{ p.name }}">{{ p.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Import everything</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Import</button>
|
||||
</form>
|
||||
<div class="table-wrap scroll">
|
||||
<table>
|
||||
<thead><tr><th>Name</th><th></th></tr></thead>
|
||||
<tbody>
|
||||
{% for name in contents %}
|
||||
<tr>
|
||||
<td class="mono">{{ name }}</td>
|
||||
<td class="actions-cell">
|
||||
<form method="post" action="/import/run" class="inline">
|
||||
<input type="hidden" name="source" value="{{ name }}">
|
||||
<button type="submit" class="btn btn-sm btn-ghost">Import this</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr class="empty-row"><td colspan="2">
|
||||
<div class="empty-state">
|
||||
<span class="sparkle" style="position:relative; display:inline-block; margin-bottom:0.5rem;"></span>
|
||||
<p class="muted" style="margin:0;">Nothing waiting. Drop a file above to get started.</p>
|
||||
</div>
|
||||
</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{% set status_badge = {"running": "badge-info badge-pulse", "success": "badge-success", "failed": "badge-danger", "skipped_lock": "badge-muted"} %}
|
||||
{% for run in recent_runs %}
|
||||
<tr>
|
||||
<td>{{ run.job_key }}</td>
|
||||
<td title="{{ run.job_key }}">{{ humanize_job_key(run.job_key) }}</td>
|
||||
<td><span class="badge {{ status_badge.get(run.status, 'badge-muted') }}">{{ run.status }}</span></td>
|
||||
<td class="muted">{{ run.triggered_by }}</td>
|
||||
<td>{{ run.summary or "" }}</td>
|
||||
<td>{% if run.log_path %}<a href="/jobs/runs/{{ run.id }}/log" target="_blank" class="btn btn-sm btn-ghost">Log</a>{% endif %}</td>
|
||||
<td>{% if run.log_path %}<a href="/settings/jobs/runs/{{ run.id }}/log" target="_blank" class="btn btn-sm btn-ghost">Log</a>{% endif %}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr class="empty-row"><td colspan="5" class="muted">No job runs yet.</td></tr>
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
{% 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>
|
||||
{% extends "settings/_layout.html" %}
|
||||
{% block settings_title %}Jobs{% endblock %}
|
||||
{% block settings_content %}
|
||||
<h2 style="margin-top:0;">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>
|
||||
@@ -16,16 +9,16 @@
|
||||
{% 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 %}
|
||||
<div title="{{ job.job_key }}">{{ job.label }}</div>
|
||||
{% if job.description %}<div class="muted" style="font-size:0.8em; margin-top:0.15rem;">{{ 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">
|
||||
<form method="post" action="/settings/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">
|
||||
<form method="post" action="/settings/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>
|
||||
@@ -40,7 +33,7 @@
|
||||
<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">
|
||||
<tbody id="runs-tbody" hx-get="/settings/jobs/_runs_table" hx-trigger="every 5s" hx-swap="innerHTML">
|
||||
{% include "jobs/_runs_table.html" %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<p class="subtitle muted"><a href="{{ playlist.spotify_url }}">{{ playlist.spotify_url }}</a></p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<form method="post" action="/jobs/playlist:{{ playlist.name }}/run" class="inline">
|
||||
<form method="post" action="/settings/jobs/playlist:{{ playlist.name }}/run" class="inline">
|
||||
<button type="submit" class="btn btn-primary">Run now</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{% block settings_title %}Settings{% endblock %} — alembic{% endblock %}
|
||||
{% block content %}
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1>Settings</h1>
|
||||
<p class="subtitle muted">Credentials and background jobs.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-layout">
|
||||
<nav class="settings-nav">
|
||||
<a href="/settings/credentials" class="{{ 'active' if request.url.path.startswith('/settings/credentials') else '' }}">Credentials</a>
|
||||
<a href="/settings/jobs" class="{{ 'active' if request.url.path.startswith('/settings/jobs') else '' }}">Jobs</a>
|
||||
</nav>
|
||||
<div class="settings-content">
|
||||
{% block settings_content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user