diff --git a/api/action.go b/api/action.go index 1468341b9..406e496b4 100644 --- a/api/action.go +++ b/api/action.go @@ -40,7 +40,6 @@ func (a actionRoutes) getFailedActions(c *gin.Context) { } func (a actionRoutes) getActionById(c *gin.Context) { - log.Info("Getting action by id: ", c.Param("id")) ctx := context.Background() model, err := a.dao.GetActionByID(ctx, c.Param("id")) if err != nil { diff --git a/dao/Action.go b/dao/Action.go index 27f7e9df3..912921890 100644 --- a/dao/Action.go +++ b/dao/Action.go @@ -18,6 +18,7 @@ type ActionDao interface { GetAll(ctx context.Context) ([]model.Action, error) GetAllFailedActions(ctx context.Context) ([]model.Action, error) UpdateAction(ctx context.Context, action *model.Action) error + GetAllActionOfRunner(ctx context.Context, runnerID string) ([]model.Action, error) } type actionDao struct { @@ -75,3 +76,9 @@ func (d actionDao) GetAllFailedActions(ctx context.Context) ([]model.Action, err func (d actionDao) UpdateAction(ctx context.Context, action *model.Action) error { return d.db.WithContext(ctx).Model(&model.Action{}).Where("id = ?", action.ID).Updates(action).Error } + +func (d actionDao) GetAllActionOfRunner(ctx context.Context, runnerID string) ([]model.Action, error) { + var actions []model.Action + err := d.db.WithContext(ctx).Joins("AllRunners").Where("id = ?", runnerID).Find(&actions).Error + return actions, err +} diff --git a/web/template/admin/admin_tabs/runner.gohtml b/web/template/admin/admin_tabs/runner.gohtml index 06b64d233..999714b2d 100644 --- a/web/template/admin/admin_tabs/runner.gohtml +++ b/web/template/admin/admin_tabs/runner.gohtml @@ -1,7 +1,75 @@ {{define "runners"}} -
+

Runners

+ + + + + + +
+

Runners

@@ -30,21 +98,27 @@ Disk: {{$runner.Disk}}
- {{if $runner.IsAlive}} + {{if $runner.IsAlive}} Alive{{else}} Dead{{end}} - {{$runner.Uptime}} - - - + + + - - +
-
-
-

failed actions

-