Add workflow

This commit is contained in:
Lunny Xiao
2022-10-17 00:32:00 +08:00
committed by Jason Song
parent f75a4abc5d
commit 243c1e5134
3 changed files with 39 additions and 2 deletions

View File

@ -11,8 +11,20 @@ import (
)
func BuildView(ctx *context.Context) {
ctx.Data["RunID"] = ctx.Params("runid")
ctx.Data["JobID"] = ctx.Params("jobid")
runID := ctx.ParamsInt64("runid")
ctx.Data["RunID"] = runID
jobID := ctx.ParamsInt64("jobid")
if jobID <= 0 {
runJobs, err := bots_model.GetRunJobsByRunID(ctx, runID)
if err != nil {
return
}
if len(runJobs) <= 0 {
return
}
jobID = runJobs[0].ID
}
ctx.Data["JobID"] = jobID
ctx.HTML(http.StatusOK, "dev/buildview")
}