示例#1
0
func requestJobs(r render.Render, req *http.Request) {

	if req.URL.Query().Get("json") != "" {
		r.JSON(200, jobrunner.StatusJson())
	} else {
		r.HTML(200, "jobs/Status", jobrunner.StatusPage())
	}
}
示例#2
0
func JobHtml(c *gin.Context) {
	Template := template.New("Status")
	s, err := Template.Parse(status)
	if err != nil {
		fmt.Println("err:", err)
		return
	}
	s.Execute(c.Writer, jobrunner.StatusPage())
}
示例#3
0
func JobHtml(c *gin.Context) {
	// Returns the template data pre-parsed
	c.HTML(200, "", jobrunner.StatusPage())
}