package webcmd import ( "fmt" "net/http" "time" ) func (this *App) Serve_Tasks(w http.ResponseWriter) { w.Header().Set("Content-Type", "text/html;charset=UTF-8") w.WriteHeader(200) this.ServePartial_Header(w, "/tasks") fmt.Fprint(w, ` `) this.tasksMtx.RLock() defer this.tasksMtx.RUnlock() for ref, t := range this.tasks { fmt.Fprintf(w, ` `) } fmt.Fprint(w, `
Task Started State
%s %s `, hesc(ref), hesc(ref), hesc(time.Unix(t.started, 0).Format(time.RFC822Z)), ) if t.Finished() { fmt.Fprint(w, `Finished`) } else { fmt.Fprint(w, `Running`) } fmt.Fprint(w, `
`) this.ServePartial_Footer(w) }