Replaces the five novelty themes with one professional dark theme built on a shared token set (surfaces, 6-step type scale, semantic colours, 44px tap target) used across dashboard, login and settings. Layout now matches the cache tiers in app.py: a "Right now" strip with live streams, the download queue and array usage sits above the fold, with library, discovery, requests and watch insights below. Previously the page opened on rarely-actionable disk stats and buried active streams under twenty recommendation rows. Also from the design review: - Discover lists show 5 with a Show more toggle instead of 10 each - RT descriptions render inline and clamped, not hover-only tooltips that touch devices could never reach - Adding a title is now two-step (tap to arm, tap to confirm) since it queues a real download - role=alert on errors, aria-live on polled regions, semantic dl/dt/dd stats, labelled search inputs - every text/surface pair verified at >= 5:1 contrast Drops the dead delete-modal JS, which threw a TypeError on every load, and the stale root-level template copies that Flask never rendered. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
339 lines
11 KiB
HTML
339 lines
11 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Settings — Media Centre</title>
|
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='22' fill='%237aa2f7'/><path d='M40 32 L72 50 L40 68 Z' fill='%230f1319'/></svg>">
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--bg: #0f1319;
|
|
--surface: #161b23;
|
|
--surface-2: #1c222c;
|
|
--border: #262e3a;
|
|
--border-lt: #333d4d;
|
|
--text: #e6ebf2;
|
|
--text-2: #a8b3c4;
|
|
--text-3: #8592a6;
|
|
--accent: #7aa2f7;
|
|
--ok: #4ade80;
|
|
--danger: #f87171;
|
|
--fs-xs: 0.75rem;
|
|
--fs-sm: 0.8125rem;
|
|
--fs-base: 0.9375rem;
|
|
--fs-lg: 1.125rem;
|
|
--gap: 1rem;
|
|
--radius: 10px;
|
|
--radius-sm: 7px;
|
|
--tap: 44px;
|
|
--font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
|
|
}
|
|
|
|
*, *::before, *::after { box-sizing: border-box; }
|
|
|
|
body {
|
|
margin: 0;
|
|
font-family: var(--font);
|
|
font-size: var(--fs-base);
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
line-height: 1.5;
|
|
-webkit-font-smoothing: antialiased;
|
|
}
|
|
|
|
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
|
|
|
|
header {
|
|
background: var(--surface);
|
|
border-bottom: 1px solid var(--border);
|
|
padding: 0.75rem 1.5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.65rem;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
}
|
|
header h1 {
|
|
margin: 0;
|
|
font-size: var(--fs-lg);
|
|
font-weight: 600;
|
|
letter-spacing: -0.01em;
|
|
}
|
|
.back-btn {
|
|
margin-left: auto;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
min-height: var(--tap);
|
|
padding: 0 0.9rem;
|
|
background: var(--surface-2);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius-sm);
|
|
color: var(--text-2);
|
|
font-size: var(--fs-sm);
|
|
text-decoration: none;
|
|
white-space: nowrap;
|
|
transition: color 0.2s, border-color 0.2s;
|
|
}
|
|
.back-btn:hover { color: var(--text); border-color: var(--border-lt); }
|
|
|
|
main { padding: 1.5rem; max-width: 900px; margin: 0 auto; }
|
|
|
|
.grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
|
gap: var(--gap);
|
|
}
|
|
.full { grid-column: 1 / -1; }
|
|
|
|
.card {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius);
|
|
}
|
|
.card-header {
|
|
padding: 0.85rem 1.1rem;
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
.card-header h2 {
|
|
margin: 0;
|
|
font-size: var(--fs-sm);
|
|
font-weight: 600;
|
|
}
|
|
.card-body { padding: 1.1rem; }
|
|
|
|
.field { margin-bottom: 0.9rem; }
|
|
label {
|
|
display: block;
|
|
font-size: var(--fs-xs);
|
|
font-weight: 600;
|
|
color: var(--text-2);
|
|
margin-bottom: 0.35rem;
|
|
}
|
|
input, select {
|
|
width: 100%;
|
|
min-height: var(--tap);
|
|
padding: 0 0.8rem;
|
|
background: var(--surface-2);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius-sm);
|
|
color: var(--text);
|
|
font-family: inherit;
|
|
font-size: 16px; /* prevents iOS zoom on focus */
|
|
outline: none;
|
|
transition: border-color 0.2s;
|
|
}
|
|
input:focus, select:focus { border-color: var(--accent); }
|
|
input::placeholder { color: var(--text-3); }
|
|
|
|
.hint {
|
|
font-size: var(--fs-xs);
|
|
color: var(--text-3);
|
|
margin-top: 0.35rem;
|
|
}
|
|
|
|
button.save {
|
|
width: 100%;
|
|
min-height: var(--tap);
|
|
background: var(--accent);
|
|
color: var(--bg);
|
|
border: none;
|
|
border-radius: var(--radius-sm);
|
|
font-family: inherit;
|
|
font-size: var(--fs-sm);
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: opacity 0.15s;
|
|
}
|
|
button.save:hover:not(:disabled) { opacity: 0.88; }
|
|
button.save:disabled { background: var(--border); color: var(--text-3); cursor: default; }
|
|
|
|
.error-inline {
|
|
font-size: var(--fs-xs);
|
|
color: var(--danger);
|
|
display: none;
|
|
margin-top: 0.35rem;
|
|
}
|
|
|
|
.toast {
|
|
position: fixed;
|
|
bottom: 1.5rem;
|
|
right: 1.5rem;
|
|
background: var(--surface);
|
|
border: 1px solid var(--ok);
|
|
color: var(--ok);
|
|
padding: 0.7rem 1.1rem;
|
|
border-radius: var(--radius-sm);
|
|
font-size: var(--fs-sm);
|
|
font-weight: 500;
|
|
opacity: 0;
|
|
transition: opacity 0.3s;
|
|
pointer-events: none;
|
|
max-width: calc(100vw - 3rem);
|
|
}
|
|
.toast.error { border-color: var(--danger); color: var(--danger); }
|
|
.toast.show { opacity: 1; }
|
|
|
|
@media (max-width: 600px) {
|
|
header { padding: 0.7rem 1rem; }
|
|
main { padding: 1rem; }
|
|
.toast { left: 1rem; right: 1rem; bottom: 1rem; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<header>
|
|
<svg width="30" height="30" viewBox="0 0 100 100" aria-hidden="true">
|
|
<rect width="100" height="100" rx="22" fill="var(--accent)"/>
|
|
<path d="M40 32 L72 50 L40 68 Z" fill="var(--bg)"/>
|
|
</svg>
|
|
<h1>Settings</h1>
|
|
<a href="{{ url_for('dashboard') }}" class="back-btn">← Dashboard</a>
|
|
</header>
|
|
|
|
<main>
|
|
<div class="grid">
|
|
|
|
<!-- General -->
|
|
<div class="card full">
|
|
<div class="card-header"><h2>General</h2></div>
|
|
<div class="card-body">
|
|
<div class="field">
|
|
<label for="timezone">Timezone</label>
|
|
<select id="timezone">
|
|
{% set tzs = [
|
|
'America/New_York','America/Chicago','America/Denver','America/Los_Angeles',
|
|
'America/Toronto','America/Vancouver','America/Phoenix','America/Halifax',
|
|
'Europe/London','Europe/Paris','Europe/Berlin','Europe/Amsterdam',
|
|
'Europe/Stockholm','Europe/Rome','Europe/Madrid','Europe/Zurich',
|
|
'Australia/Sydney','Australia/Melbourne','Australia/Brisbane','Australia/Perth',
|
|
'Pacific/Auckland','Asia/Tokyo','Asia/Singapore','Asia/Dubai','Asia/Kolkata'
|
|
] %}
|
|
{% for tz in tzs %}
|
|
<option value="{{ tz }}" {% if tz == timezone %}selected{% endif %}>{{ tz }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div class="field">
|
|
<label for="arr_host">Host IP (ARR_HOST)</label>
|
|
<input type="text" id="arr_host" value="{{ arr_host }}" placeholder="e.g. 192.168.86.33">
|
|
<p class="hint">LAN address of the machine running Sonarr, Radarr, and the rest.</p>
|
|
</div>
|
|
<button class="save" onclick="saveGeneral()">Save general</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Change password -->
|
|
<div class="card full">
|
|
<div class="card-header"><h2>Change password</h2></div>
|
|
<div class="card-body">
|
|
<div class="field">
|
|
<label for="pw_current">Current password</label>
|
|
<input type="password" id="pw_current" autocomplete="current-password">
|
|
</div>
|
|
<div class="field">
|
|
<label for="pw_new">New password</label>
|
|
<input type="password" id="pw_new" placeholder="At least 6 characters" autocomplete="new-password">
|
|
</div>
|
|
<div class="field">
|
|
<label for="pw_confirm">Confirm new password</label>
|
|
<input type="password" id="pw_confirm" autocomplete="new-password">
|
|
<div class="error-inline" id="pw-error" role="alert"></div>
|
|
</div>
|
|
<button class="save" onclick="changePassword()">Update password</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Service API keys -->
|
|
{% for svc, label in [
|
|
('sonarr','Sonarr'), ('radarr','Radarr'), ('sabnzbd','SABnzbd'),
|
|
('tautulli','Tautulli'), ('prowlarr','Prowlarr'), ('ombi','Ombi')
|
|
] %}
|
|
<div class="card">
|
|
<div class="card-header"><h2>{{ label }}</h2></div>
|
|
<div class="card-body">
|
|
<div class="field">
|
|
<label for="{{ svc }}_api_key">API key</label>
|
|
<input type="password" id="{{ svc }}_api_key"
|
|
value="{{ {'sonarr': sonarr_api_key, 'radarr': radarr_api_key,
|
|
'sabnzbd': sabnzbd_api_key, 'tautulli': tautulli_api_key,
|
|
'prowlarr': prowlarr_api_key, 'ombi': ombi_api_key}[svc] }}"
|
|
autocomplete="off">
|
|
</div>
|
|
<button class="save" onclick="saveService('{{ svc }}')">Save</button>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
</div>
|
|
</main>
|
|
|
|
<div class="toast" id="toast" role="status" aria-live="polite"></div>
|
|
|
|
<script>
|
|
function showToast(msg, isError) {
|
|
const t = document.getElementById('toast');
|
|
t.textContent = msg;
|
|
t.classList.toggle('error', !!isError);
|
|
t.classList.add('show');
|
|
setTimeout(() => t.classList.remove('show'), 2800);
|
|
}
|
|
|
|
async function post(url, payload) {
|
|
return fetch(url, {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
credentials: 'include',
|
|
body: JSON.stringify(payload)
|
|
});
|
|
}
|
|
|
|
async function saveGeneral() {
|
|
try {
|
|
const resp = await post('/api/settings', {
|
|
timezone: document.getElementById('timezone').value,
|
|
arr_host: document.getElementById('arr_host').value.trim()
|
|
});
|
|
showToast(resp.ok ? 'General settings saved — reload the dashboard to apply.'
|
|
: 'Save failed.', !resp.ok);
|
|
} catch (e) { showToast('Network error — not saved.', true); }
|
|
}
|
|
|
|
async function saveService(name) {
|
|
try {
|
|
const key = document.getElementById(name + '_api_key').value.trim();
|
|
const resp = await post('/api/settings', { [name + '_api_key']: key });
|
|
const label = name.charAt(0).toUpperCase() + name.slice(1);
|
|
showToast(resp.ok ? label + ' key saved — restart the container to apply.'
|
|
: 'Save failed.', !resp.ok);
|
|
} catch (e) { showToast('Network error — not saved.', true); }
|
|
}
|
|
|
|
async function changePassword() {
|
|
const errEl = document.getElementById('pw-error');
|
|
errEl.style.display = 'none';
|
|
try {
|
|
const resp = await post('/api/change-password', {
|
|
current: document.getElementById('pw_current').value,
|
|
new: document.getElementById('pw_new').value,
|
|
confirm: document.getElementById('pw_confirm').value
|
|
});
|
|
const data = await resp.json();
|
|
if (resp.ok) {
|
|
['pw_current', 'pw_new', 'pw_confirm'].forEach(id => document.getElementById(id).value = '');
|
|
showToast('Password updated.');
|
|
} else {
|
|
errEl.textContent = data.error || 'Failed to update password.';
|
|
errEl.style.display = 'block';
|
|
showToast(data.error || 'Failed to update password.', true);
|
|
}
|
|
} catch (e) { showToast('Network error — password not changed.', true); }
|
|
}
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|