Signup is limited to the first user by default (UPTIME_SIGNUP). TOTP secrets are sealed with UPTIME_SECRET_KEYS and bound to the user id. Closes #3 Closes #5 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017GpWAskjmYtZpuQ5JwYTX3
60 lines
1.5 KiB
Templ
60 lines
1.5 KiB
Templ
package web
|
|
|
|
type Page struct {
|
|
Title string
|
|
CSRF string
|
|
}
|
|
|
|
templ Layout(p Page) {
|
|
<!DOCTYPE html>
|
|
<html lang="de">
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
if p.CSRF != "" {
|
|
<meta name="csrf-token" content={ p.CSRF }/>
|
|
}
|
|
<title>{ p.Title } · uptimesebi</title>
|
|
<link rel="stylesheet" href="/static/dist/app.css"/>
|
|
<script src="/static/dist/axios.min.js" defer></script>
|
|
<script src="/static/dist/app.js" defer></script>
|
|
</head>
|
|
<body class="min-h-screen">
|
|
{ children... }
|
|
</body>
|
|
</html>
|
|
}
|
|
|
|
templ authShell(p Page, heading string) {
|
|
@Layout(p) {
|
|
<main class="mx-auto mt-[12vh] w-full max-w-sm px-6">
|
|
<p class="mb-10 font-mono text-xs tracking-wide text-muted">uptimesebi</p>
|
|
<h1 class="mb-6 text-xl font-semibold">{ heading }</h1>
|
|
{ children... }
|
|
</main>
|
|
}
|
|
}
|
|
|
|
templ field(label, name, typ, autocomplete string, required bool) {
|
|
<label class="mb-4 block">
|
|
<span class="mb-1 block text-xs font-medium uppercase tracking-wider text-muted">{ label }</span>
|
|
<input
|
|
class="w-full border border-rule bg-transparent px-2.5 py-1.5 outline-none focus:border-ink"
|
|
type={ typ }
|
|
name={ name }
|
|
autocomplete={ autocomplete }
|
|
required?={ required }
|
|
/>
|
|
</label>
|
|
}
|
|
|
|
templ submit(label string) {
|
|
<button type="submit" class="mt-2 w-full bg-ink px-3 py-2 text-sm font-medium text-paper hover:opacity-90 disabled:opacity-50">
|
|
{ label }
|
|
</button>
|
|
}
|
|
|
|
templ formError() {
|
|
<p data-error class="mb-4 hidden border-l-2 border-down pl-2 text-sm text-down"></p>
|
|
}
|