1
0
Fork 0

Bundle dashboard template

This commit is contained in:
Gregory Eremin 2015-01-26 15:07:23 +07:00
parent 0c2cdd5502
commit b03853d609
2 changed files with 6 additions and 4 deletions

View File

@ -1,3 +1,6 @@
package server
const dashboardTmpl = `
{{define "dashboard"}}
<!DOCTYPE html>
@ -194,3 +197,4 @@ loop(1000, function(){
</html>
{{end}}
`

View File

@ -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()