Bundle dashboard template

This commit is contained in:
2015-01-26 15:07:23 +07:00
parent 0c2cdd5502
commit b03853d609
2 changed files with 6 additions and 4 deletions
@@ -1,3 +1,6 @@
package server
const dashboardTmpl = `
{{define "dashboard"}}
<!DOCTYPE html>
@@ -194,3 +197,4 @@ loop(1000, function(){
</html>
{{end}}
`
+2 -4
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()