feat: add Web UI server with basic-auth and artist dashboard
This commit is contained in:
49
internal/web/templates/dashboard.html
Normal file
49
internal/web/templates/dashboard.html
Normal file
@@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>NaviWatcher — Dashboard</title>
|
||||
<style>
|
||||
body { font-family: system-ui, sans-serif; margin: 2rem; color: #1a1a1a; }
|
||||
h1 { margin-bottom: 0.25rem; }
|
||||
.sub { color: #666; margin-bottom: 1.5rem; }
|
||||
table { border-collapse: collapse; width: 100%; }
|
||||
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid #e2e2e2; }
|
||||
th { background: #f6f6f6; }
|
||||
.count { font-weight: bold; }
|
||||
.count-zero { color: #2e7d32; }
|
||||
.count-missing { color: #c62828; }
|
||||
.empty { color: #888; font-style: italic; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>NaviWatcher</h1>
|
||||
<div class="sub">Monitored artists: {{ len .Artists }} · Missing releases: {{ .TotalMissing }}</div>
|
||||
|
||||
{{ if .Artists }}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Artist</th>
|
||||
<th>Missing</th>
|
||||
<th>MusicBrainz</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range .Artists }}
|
||||
<tr>
|
||||
<td>{{ .Name }}</td>
|
||||
<td class="count {{ if eq .MissingCount 0 }}count-zero{{ else }}count-missing{{ end }}">
|
||||
{{ .MissingCount }}
|
||||
</td>
|
||||
<td>{{ if .MBID }}{{ .MBID }}{{ else }}<span class="empty">—</span>{{ end }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ else }}
|
||||
<p class="empty">No monitored artists yet. Run a sync to populate the dashboard.</p>
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user