diff --git a/pkg/webui/error.go b/pkg/webui/error.go index 05d8e9e..afce9a6 100644 --- a/pkg/webui/error.go +++ b/pkg/webui/error.go @@ -9,11 +9,13 @@ var errorTemplates = template.Must(template.ParseFS(htmlFS, "html/base.html", "h func errorResponse(w http.ResponseWriter, status int, err error) { type ErrorData struct { + Page Err error Status int StatusText string } render(w, errorTemplates, status, &ErrorData{ + Page: Page{Title: "Error", Section: "error"}, Err: err, Status: status, StatusText: http.StatusText(status), diff --git a/pkg/webui/html/base.html b/pkg/webui/html/base.html index 7821d28..06328e4 100644 --- a/pkg/webui/html/base.html +++ b/pkg/webui/html/base.html @@ -1,28 +1,50 @@ +{{ define "nav" }} +
+ +
+{{ if eq .Page.Section "login" }} + + login + Login + +{{ else }} + + home_storage + States + +
+ + logout + Logout + +{{ end }} +{{ end }} - + - - - tfstated + + + TFSTATED - {{ .Page.Title }} - -
+ + + + +
-
- {{ template "main" . }} -
-