Bundle dashboard template
This commit is contained in:
parent
0c2cdd5502
commit
b03853d609
|
@ -1,3 +1,6 @@
|
|||
package server
|
||||
|
||||
const dashboardTmpl = `
|
||||
{{define "dashboard"}}
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
@ -194,3 +197,4 @@ loop(1000, function(){
|
|||
</html>
|
||||
|
||||
{{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) {
|
||||
tmpl, err := template.ParseFiles("server/dashboard.tmpl")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
tmpl := template.New("dashboard")
|
||||
tmpl, _ = tmpl.Parse(dashboardTmpl)
|
||||
|
||||
w.Header().Set("Content-Type", "text/html; charset=utf8")
|
||||
hostname, _ := os.Hostname()
|
||||
|
|
Loading…
Reference in New Issue