Bundle dashboard template
This commit is contained in:
parent
0c2cdd5502
commit
b03853d609
@ -1,3 +1,6 @@
|
|||||||
|
package server
|
||||||
|
|
||||||
|
const dashboardTmpl = `
|
||||||
{{define "dashboard"}}
|
{{define "dashboard"}}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
@ -194,3 +197,4 @@ loop(1000, function(){
|
|||||||
</html>
|
</html>
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
`
|
@ -115,10 +115,8 @@ func (s *Server) flushHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) dashboardHandler(w http.ResponseWriter, r *http.Request) {
|
func (s *Server) dashboardHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
tmpl, err := template.ParseFiles("server/dashboard.tmpl")
|
tmpl := template.New("dashboard")
|
||||||
if err != nil {
|
tmpl, _ = tmpl.Parse(dashboardTmpl)
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf8")
|
w.Header().Set("Content-Type", "text/html; charset=utf8")
|
||||||
hostname, _ := os.Hostname()
|
hostname, _ := os.Hostname()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user