feat(web): overview page with verdict line and stats doors (#143)

This commit is contained in:
2026-08-22 00:49:39 +07:00
parent 6f9109c885
commit c432a3be30
6 changed files with 489 additions and 5 deletions
+12 -2
View File
@@ -25,6 +25,8 @@ type adminView struct {
SeriesList seriesListView
// Detail is the per-Series page data; zero on every other page.
Detail seriesDetailView
// Overview is the landing page data; zero on every other page.
Overview overviewView
}
// adminRoute pairs a route pattern with its handler so the route list and the
@@ -76,9 +78,17 @@ func (h *Handler) requireOwner(next http.HandlerFunc) http.HandlerFunc {
})
}
// admin renders the Overview shell. Its data arrives in later admin tickets.
// admin renders the Overview landing page: a verdict line, a stats block
// where every figure is a door into the list it counts, and the per-Site
// library shape table — all read from the database, never from a poller.
func (h *Handler) admin(w http.ResponseWriter, r *http.Request) {
h.renderAdmin(w, adminView{Page: "overview"})
view, err := h.overviewView()
if err != nil {
log.Printf("admin overview: %v", err)
http.Error(w, "internal error", http.StatusInternalServerError)
return
}
h.renderAdmin(w, adminView{Page: "overview", Overview: view})
}
// adminReaders renders the Reader roster on its own bookmarkable page.