aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/actions/view.go
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-04-08 07:20:50 +0900
committerGitHub <noreply@github.com>2023-04-07 18:20:50 -0400
commit68aac691c1941da1fe69eaa457d18662192a7602 (patch)
tree3b0ddd7ad20705b19bf4a1f3e86e00234cec6b61 /routers/web/repo/actions/view.go
parentc0246677a692de804ffe1bb5f7d630fb002dd128 (diff)
downloadgitea-68aac691c1941da1fe69eaa457d18662192a7602.tar.gz
gitea-68aac691c1941da1fe69eaa457d18662192a7602.zip
Add job.duration in web ui (#23963)
![image](https://user-images.githubusercontent.com/18380374/230532947-271ac389-8134-4c5e-8f2f-ced4a4fd0ebe.png) ![image](https://user-images.githubusercontent.com/18380374/230532963-e76532c5-7ca1-4b01-ae77-cc1223350fe7.png) Maybe we can change the location of it.
Diffstat (limited to 'routers/web/repo/actions/view.go')
-rw-r--r--routers/web/repo/actions/view.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go
index b2b625ea23..c553aef9ae 100644
--- a/routers/web/repo/actions/view.go
+++ b/routers/web/repo/actions/view.go
@@ -75,6 +75,7 @@ type ViewJob struct {
Name string `json:"name"`
Status string `json:"status"`
CanRerun bool `json:"canRerun"`
+ Duration string `json:"duration"`
}
type ViewCommit struct {
@@ -144,6 +145,7 @@ func ViewPost(ctx *context_module.Context) {
Name: v.Name,
Status: v.Status.String(),
CanRerun: v.Status.IsDone() && ctx.Repo.CanWrite(unit.TypeActions),
+ Duration: v.Duration().String(),
})
}