From 96e03af79c671f36e03eacdc8767dcbb801aed9d Mon Sep 17 00:00:00 2001 From: boyska Date: Tue, 13 Nov 2018 15:09:49 +0100 Subject: [PATCH] http prefix --- panelui/res/templates/home.html | 6 +++--- panelui/template_utils.go | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/panelui/res/templates/home.html b/panelui/res/templates/home.html index 188148b..cc5b032 100644 --- a/panelui/res/templates/home.html +++ b/panelui/res/templates/home.html @@ -1,8 +1,8 @@ - - - + + +
diff --git a/panelui/template_utils.go b/panelui/template_utils.go index 65f3231..d486273 100644 --- a/panelui/template_utils.go +++ b/panelui/template_utils.go @@ -32,6 +32,11 @@ func templateExecute(w http.ResponseWriter, r *http.Request, name string, box *r if strings.HasSuffix(name, ".html") { w.Header().Set("Content-type", "text/html") } + if pref, has := os.LookupEnv("PANEL_PREFIX"); has { + data["BaseURL"] = pref + } else { + data["BaseURL"] = "/" + } tmpl.Execute(w, data) return nil }