mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-08-30 12:46:57 +00:00
32 lines
779 B
Go
32 lines
779 B
Go
package handlers
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
// InstallHandler handles the /install page
|
|
type InstallHandler struct {
|
|
BaseUIHandler
|
|
}
|
|
|
|
func (h *InstallHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
meta := NewPageMeta(
|
|
"Install "+h.ClientShortName+" Credential Helper - "+h.ClientShortName,
|
|
"Install the "+h.ClientShortName+" credential helper to push and pull containers using your AT Protocol identity",
|
|
).WithCanonical("https://" + h.SiteURL + "/install").
|
|
WithSiteName(h.ClientShortName)
|
|
|
|
data := struct {
|
|
PageData
|
|
Meta *PageMeta
|
|
}{
|
|
PageData: NewPageData(r, &h.BaseUIHandler),
|
|
Meta: meta,
|
|
}
|
|
|
|
if err := h.Templates.ExecuteTemplate(w, "install", data); err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
return
|
|
}
|
|
}
|