| 11 | ) |
| 12 | |
| 13 | func httpsIndex(w http.ResponseWriter, r *http.Request) { |
| 14 | tmlPath := configs.GetFilePathsConfig().AdminHtml.String() |
| 15 | tmpl, err := template.New("https.html").Funcs(funcMap).ParseFiles( |
| 16 | util.FilePath(tmlPath+"/_header.html"), |
| 17 | util.FilePath(tmlPath+"/_nav.html"), |
| 18 | util.FilePath(tmlPath+"/https.html"), |
| 19 | util.FilePath(tmlPath+"/_footer.html"), |
| 20 | ) |
| 21 | if err != nil { |
| 22 | mudlog.Error("HTML Template", "error", err) |
| 23 | http.Error(w, "Error parsing template files", http.StatusInternalServerError) |
| 24 | return |
| 25 | } |
| 26 | |
| 27 | tplData := map[string]any{ |
| 28 | "NAV": buildAdminNav(), |
| 29 | "AUTHED_USER": GetAuthedUser(r), |
| 30 | "httpsStatus": GetHTTPSStatus(), |
| 31 | } |
| 32 | |
| 33 | w.Header().Set("Cache-Control", "no-store") |
| 34 | if err := tmpl.Execute(w, tplData); err != nil { |
| 35 | mudlog.Error("HTML Execute", "error", err) |
| 36 | } |
| 37 | } |