P1-23 / P1-28: base layout, login, session-aware nav + Tailwind build
P1-28: Tailwind standalone CLI wired into the Makefile. `make tailwind` downloads the pinned v3.4.17 binary into bin/tailwindcss (gitignored), builds web/styles/input.css → web/static/css/styles.css. `make build` now runs the CSS pass first; `make tailwind-watch` for dev. Output is embedded in the binary via web.FS — single static binary, no Node. The CSS source carries every component class the v1 mockups defined (status dots, buttons, host row, log viewer, progress bar, fields, chips, snippet panel, empty state) so screens that land later can just reach for them. P1-23: html/template tree at web/templates with two layouts (base with chrome, chromeless for login + bootstrap), one nav partial, and two pages (dashboard placeholder, login). internal/server/ui parses the tree at startup; ui_handlers.go in the http package wires: GET / dashboard (303 → /login when unauthed) GET /login sign-in form POST /login consume form, mint session cookie, 303 → / POST /logout drop cookie, 303 → /login GET /static/* embedded Tailwind bundle The HTML login flow shares store/session logic with /api/auth/login via a new authenticateAndSession helper — same security guarantees, two surface representations (HTML form / JSON). Verified end-to-end: bootstrap → form-login → authed dashboard → sign-out → 303 cycle works in the browser; Tailwind output emits only the component classes referenced in the live templates (9.6kB minified). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
{{define "title"}}Dashboard · restic-manager{{end}}
|
||||
|
||||
{{define "content"}}
|
||||
<div class="max-w-[1280px] mx-auto px-8 pt-14 pb-24">
|
||||
|
||||
<!-- placeholder hero — real fleet summary lands with P1-24.
|
||||
This view exists today so the chrome + Tailwind + base layout
|
||||
can be verified in the browser end-to-end. -->
|
||||
<div class="empty-state">
|
||||
<h1 class="text-lg font-medium tracking-[-0.005em]">Dashboard</h1>
|
||||
<p class="text-pretty text-ink-mid mt-3 mx-auto max-w-[520px] text-[13px] leading-[1.65]">
|
||||
Base layout + Tailwind build wired through (P1-23 / P1-28). The fleet
|
||||
summary, host table and recent activity strip land with
|
||||
<span class="mono text-ink">P1-24</span>; until then this screen exists
|
||||
to prove the chrome renders.
|
||||
</p>
|
||||
<div class="mt-7 flex items-center justify-center gap-2">
|
||||
<a href="/hosts/new" class="btn btn-primary btn-lg">+ Add your first host</a>
|
||||
<a href="/" class="btn">Reload</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user