dashboard handler

This commit is contained in:
Jan Barfuss 2025-03-02 11:06:52 +01:00
parent b31761e6e8
commit 882548344a

View File

@ -29,6 +29,10 @@ type Claims struct {
jwt.RegisteredClaims jwt.RegisteredClaims
} }
type picture struct {
picture string
}
func SetShit() { func SetShit() {
if maxAttempts, err := strconv.Atoi(os.Getenv("CCTV_MaxFailedAttempts")); err == nil { if maxAttempts, err := strconv.Atoi(os.Getenv("CCTV_MaxFailedAttempts")); err == nil {
MaxFailedAttempts = maxAttempts MaxFailedAttempts = maxAttempts
@ -180,8 +184,10 @@ func DashboardHandler(w http.ResponseWriter, r *http.Request) {
} }
} }
p := picture{picture: newestPicture.Name()}
tmpl := template.Must(template.ParseFiles("views/dash.html")) tmpl := template.Must(template.ParseFiles("views/dash.html"))
tmpl.Execute(w, newestPicture.Name()) tmpl.Execute(w, p)
} }
func UploadHandler(w http.ResponseWriter, r *http.Request) { func UploadHandler(w http.ResponseWriter, r *http.Request) {