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_sources.go — HTML form-driven source-group CRUD. Slice 1 of
|
||||
// P2R-02 lights the tab; slice 2 fills in list, new, edit, delete,
|
||||
// and per-group Run-now.
|
||||
|
||||
type hostSourcesPage struct {
|
||||
hostChromeData
|
||||
}
|
||||
|
||||
func (s *Server) handleUIHostSources(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 + " sources · restic-manager"
|
||||
view.Page = hostSourcesPage{
|
||||
hostChromeData: s.loadHostChrome(r, *host, "sources", "sources"),
|
||||
}
|
||||
if err := s.deps.UI.Render(w, "host_sources", view); err != nil {
|
||||
slog.Error("ui: render host_sources", "err", err)
|
||||
stdhttp.Error(w, "internal", stdhttp.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user