diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go index dd2750f905..5569709368 100644 --- a/routers/web/repo/actions/view.go +++ b/routers/web/repo/actions/view.go @@ -51,6 +51,7 @@ type ViewResponse struct { Run struct { Link string `json:"link"` Title string `json:"title"` + Status string `json:"status"` CanCancel bool `json:"canCancel"` CanApprove bool `json:"canApprove"` // the run needs an approval and the doer has permission to approve Done bool `json:"done"` @@ -111,6 +112,7 @@ func ViewPost(ctx *context_module.Context) { resp.State.Run.CanApprove = run.NeedApproval && ctx.Repo.CanWrite(unit.TypeActions) resp.State.Run.Done = run.Status.IsDone() resp.State.Run.Jobs = make([]*ViewJob, 0, len(jobs)) // marshal to '[]' instead fo 'null' in json + resp.State.Run.Status = run.Status.String() for _, v := range jobs { resp.State.Run.Jobs = append(resp.State.Run.Jobs, &ViewJob{ ID: v.ID, diff --git a/web_src/js/components/RepoActionView.vue b/web_src/js/components/RepoActionView.vue index 762067f523..a5c12c754e 100644 --- a/web_src/js/components/RepoActionView.vue +++ b/web_src/js/components/RepoActionView.vue @@ -2,7 +2,13 @@
- {{ run.title }} + + + + +
+ {{ run.title }} +
@@ -99,6 +105,7 @@ const sfc = { run: { link: '', title: '', + status: '', canCancel: false, canApprove: false, done: false, @@ -327,7 +334,11 @@ export function initRepositoryActionView() { .action-info-summary { font-size: 150%; height: 20px; - padding: 0 10px; + display: flex; + + .action-title { + padding: 0 5px; + } } // ================