P2R-02 slice 1: host-detail sub-tab skeleton
Extract header/vitals/sub-tabs into a host_chrome partial that every host-detail tab page renders. Sources / Schedules / Repo go from inert divs to real <a> links backed by stub pages that share the chrome and a 'coming next' body — slices 2/3/4 fill them in. Also re-establishes the version indicator (host_schedule_version vs agent's applied_schedule_version) in the header. Drops the legacy fat-schedule list/edit templates that referenced fields removed by the P2 redesign (Manual / Paths / RetentionPolicy on Schedule); the new templates land in slice 3.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
stdhttp "net/http"
|
||||
)
|
||||
|
||||
// ui_repo.go — HTML form-driven repo-tab handlers (connection,
|
||||
// bandwidth caps, maintenance cadences, danger-zone re-init). Slice
|
||||
// 1 of P2R-02 lights the tab; slice 4 fills in the body.
|
||||
|
||||
type hostRepoPage struct {
|
||||
hostChromeData
|
||||
}
|
||||
|
||||
func (s *Server) handleUIHostRepo(w stdhttp.ResponseWriter, r *stdhttp.Request) {
|
||||
u := s.requireUIUser(w, r)
|
||||
if u == nil {
|
||||
return
|
||||
}
|
||||
host, ok := s.loadHostForUI(w, r)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
view := s.baseView(u, "dashboard")
|
||||
view.Title = host.Name + " repo · restic-manager"
|
||||
view.Page = hostRepoPage{
|
||||
hostChromeData: s.loadHostChrome(r, *host, "repo", "repo"),
|
||||
}
|
||||
if err := s.deps.UI.Render(w, "host_repo", view); err != nil {
|
||||
slog.Error("ui: render host_repo", "err", err)
|
||||
stdhttp.Error(w, "internal", stdhttp.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user