feat(webui): bootstrap session handling and login process
This commit is contained in:
parent
63e2b1b09d
commit
6e069484cb
18 changed files with 447 additions and 1 deletions
21
pkg/webui/error.go
Normal file
21
pkg/webui/error.go
Normal file
|
@ -0,0 +1,21 @@
|
|||
package webui
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
var errorTemplates = template.Must(template.ParseFS(htmlFS, "html/base.html", "html/error.html"))
|
||||
|
||||
func errorResponse(w http.ResponseWriter, status int, err error) {
|
||||
type ErrorData struct {
|
||||
Err error
|
||||
Status int
|
||||
StatusText string
|
||||
}
|
||||
render(w, errorTemplates, status, &ErrorData{
|
||||
Err: err,
|
||||
Status: status,
|
||||
StatusText: http.StatusText(status),
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue