feat(runner-view): add task list in runnder details page, in admin

This commit is contained in:
fuxiaohei
2022-11-04 21:11:59 +08:00
committed by Jason Song
parent 8a8214113b
commit 8c3ed11ed9
8 changed files with 245 additions and 33 deletions

View File

@@ -80,6 +80,21 @@ func RunnerDetails(ctx *context.Context, tplName base.TplName, runnerID int64, o
ctx.Data["Runner"] = runner
// TODO: get task list for this runner
tasks, _, err := bots_model.FindTasks(ctx, bots_model.FindTaskOptions{
Status: bots_model.StatusUnknown, // Unknown means all
IDOrderDesc: true,
RunnerID: runner.ID,
})
if err != nil {
ctx.ServerError("FindTasks", err)
return
}
if err = tasks.LoadAttributes(ctx); err != nil {
ctx.ServerError("TasksLoadAttributes", err)
return
}
ctx.Data["Tasks"] = tasks
ctx.HTML(http.StatusOK, tplName)
}