boyska 5 éve
szülő
commit
96e03af79c
2 módosított fájl, 8 hozzáadás és 3 törlés
  1. 3 3
      panelui/res/templates/home.html
  2. 5 0
      panelui/template_utils.go

+ 3 - 3
panelui/res/templates/home.html

@@ -1,8 +1,8 @@
 <html>
     <head>
-        <!-- TODO: utf8 -->
-<link rel="stylesheet" href="/static/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
-<script src="/static/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
+        <meta charset="UTF-8">
+        <link rel="stylesheet" href="{{.BaseURL}}static/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
+<script src="{{.BaseURL}}static/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
     </head>
     <body>
         <div class="container">

+ 5 - 0
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
 }