148 lines
4.7 KiB
HTML
148 lines
4.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>tüit Transkriptor — Ersteinrichtung</title>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link href="https://fonts.googleapis.com/css2?family=Overpass:wght@300;400;600;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
:root {
|
|
--red: #DA251C;
|
|
--yellow: #FFD802;
|
|
--bg: #111;
|
|
--surface: #1a1a1a;
|
|
--text: #e8e8e8;
|
|
--muted: #888;
|
|
--border: #2e2e2e;
|
|
}
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
body {
|
|
font-family: 'Overpass', system-ui, sans-serif;
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
.card {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: 12px;
|
|
padding: 40px;
|
|
width: 100%;
|
|
max-width: 420px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 24px;
|
|
}
|
|
.logo { display: flex; align-items: center; gap: 10px; }
|
|
.logo-dot { width: 12px; height: 12px; background: var(--red); border-radius: 50%; flex-shrink: 0; }
|
|
.logo h1 { font-size: 1.1rem; font-weight: 600; }
|
|
.logo h1 span { color: var(--red); }
|
|
.subtitle { font-size: 0.85rem; color: var(--muted); }
|
|
.field { display: flex; flex-direction: column; gap: 6px; }
|
|
label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
|
|
input {
|
|
background: #111;
|
|
border: 1px solid var(--border);
|
|
color: var(--text);
|
|
border-radius: 6px;
|
|
padding: 10px 12px;
|
|
font-family: inherit;
|
|
font-size: 0.9rem;
|
|
outline: none;
|
|
transition: border-color 0.15s;
|
|
}
|
|
input:focus { border-color: var(--yellow); }
|
|
button {
|
|
background: var(--red);
|
|
color: #fff;
|
|
border: none;
|
|
border-radius: 6px;
|
|
padding: 12px;
|
|
font-family: inherit;
|
|
font-size: 0.9rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: opacity 0.15s;
|
|
}
|
|
button:hover { opacity: 0.88; }
|
|
.error {
|
|
background: rgba(218,37,28,0.12);
|
|
border: 1px solid rgba(218,37,28,0.3);
|
|
border-radius: 6px;
|
|
padding: 10px 12px;
|
|
font-size: 0.85rem;
|
|
color: #f87171;
|
|
display: none;
|
|
}
|
|
.error.visible { display: block; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="card">
|
|
<div class="logo">
|
|
<div class="logo-dot"></div>
|
|
<h1>tüit <span>Transkriptor</span></h1>
|
|
</div>
|
|
<p class="subtitle">Ersteinrichtung — lege den Administrator-Account an.</p>
|
|
|
|
<div class="error" id="error"></div>
|
|
|
|
<div class="field">
|
|
<label for="username">Benutzername</label>
|
|
<input type="text" id="username" autocomplete="username" autofocus>
|
|
</div>
|
|
<div class="field">
|
|
<label for="password">Passwort</label>
|
|
<input type="password" id="password" autocomplete="new-password">
|
|
</div>
|
|
<div class="field">
|
|
<label for="confirm">Passwort bestätigen</label>
|
|
<input type="password" id="confirm" autocomplete="new-password">
|
|
</div>
|
|
<div class="field">
|
|
<label for="output_dir">Transkripte speichern unter</label>
|
|
<input type="text" id="output_dir" placeholder="~/cloud.shron.de/Hetzner Storagebox/work">
|
|
</div>
|
|
|
|
<button id="submit-btn">Einrichtung abschließen</button>
|
|
</div>
|
|
|
|
<script>
|
|
document.getElementById('submit-btn').addEventListener('click', async () => {
|
|
const username = document.getElementById('username').value.trim();
|
|
const password = document.getElementById('password').value;
|
|
const confirm = document.getElementById('confirm').value;
|
|
const output_dir = document.getElementById('output_dir').value.trim();
|
|
const errorEl = document.getElementById('error');
|
|
|
|
errorEl.classList.remove('visible');
|
|
|
|
if (!username) return showError('Benutzername darf nicht leer sein.');
|
|
if (password.length < 6) return showError('Passwort muss mindestens 6 Zeichen lang sein.');
|
|
if (password !== confirm) return showError('Passwörter stimmen nicht überein.');
|
|
|
|
const r = await fetch('/setup', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({ username, password, output_dir: output_dir || null }),
|
|
});
|
|
const data = await r.json();
|
|
if (data.ok) {
|
|
window.location.href = '/';
|
|
} else {
|
|
showError(data.error || 'Fehler bei der Einrichtung.');
|
|
}
|
|
|
|
function showError(msg) {
|
|
errorEl.textContent = msg;
|
|
errorEl.classList.add('visible');
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|