func show_log(session *http.Session) { session.Stash["Title"] = "websysd log" session.Stash["Page"] = "AppLog" session.Stash["LogOutput"] = applog.String() session.RenderWithLayout("applog.html", "layout.html", "Content") }
func list_workspaces(session *http.Session) { // Stash a value and render a template session.Stash["Title"] = "websysd" session.Stash["Page"] = "Workspaces" session.Stash["Workspaces"] = Workspaces session.RenderWithLayout("workspaces.html", "layout.html", "Content") }
func list_tasks(session *http.Session) { ws, _ := session.Stash["workspace"].(string) // Stash a value and render a template session.Stash["Title"] = "websysd" session.Stash["Page"] = "Tasks" session.Stash["Workspace"] = Workspaces[ws] session.Stash["Tasks"] = Workspaces[ws].Tasks session.RenderWithLayout("tasks.html", "layout.html", "Content") }
func taskHistory(session *http.Session) { ws, _ := session.Stash["workspace"].(string) id, _ := session.Stash["task"].(string) session.Stash["Title"] = "Task" session.Stash["Page"] = "History" session.Stash["Workspace"] = Workspaces[ws] session.Stash["Task"] = Workspaces[ws].Tasks[id] session.RenderWithLayout("task.html", "layout.html", "Content") }
func taskRun(session *http.Session) { ws, _ := session.Stash["workspace"].(string) id, _ := session.Stash["task"].(string) run, _ := strconv.Atoi(session.Stash["run"].(string)) session.Stash["Title"] = "Task run" session.Stash["Page"] = "TaskRun" session.Stash["Workspace"] = Workspaces[ws] session.Stash["Task"] = Workspaces[ws].Tasks[id] session.Stash["TaskRun"] = Workspaces[ws].Tasks[id].TaskRuns[run] session.RenderWithLayout("taskrun.html", "layout.html", "Content") }
func taskRunStderr(session *http.Session) { ws, _ := session.Stash["workspace"].(string) id, _ := session.Stash["task"].(string) run, _ := strconv.Atoi(session.Stash["run"].(string)) session.Stash["Title"] = "Task run stderr" session.Stash["Page"] = "TaskOutput" session.Stash["Type"] = "stderr" session.Stash["Workspace"] = Workspaces[ws] session.Stash["Task"] = Workspaces[ws].Tasks[id] session.Stash["TaskRun"] = Workspaces[ws].Tasks[id].TaskRuns[run] session.Stash["LogOutput"] = Workspaces[ws].Tasks[id].TaskRuns[run].StderrBuf.String() session.RenderWithLayout("log.html", "layout.html", "Content") }