File tree 2 files changed +15
-2
lines changed
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ type ViewResponse struct {
51
51
Run struct {
52
52
Link string `json:"link"`
53
53
Title string `json:"title"`
54
+ Status string `json:"status"`
54
55
CanCancel bool `json:"canCancel"`
55
56
CanApprove bool `json:"canApprove"` // the run needs an approval and the doer has permission to approve
56
57
Done bool `json:"done"`
@@ -111,6 +112,7 @@ func ViewPost(ctx *context_module.Context) {
111
112
resp .State .Run .CanApprove = run .NeedApproval && ctx .Repo .CanWrite (unit .TypeActions )
112
113
resp .State .Run .Done = run .Status .IsDone ()
113
114
resp .State .Run .Jobs = make ([]* ViewJob , 0 , len (jobs )) // marshal to '[]' instead fo 'null' in json
115
+ resp .State .Run .Status = run .Status .String ()
114
116
for _ , v := range jobs {
115
117
resp .State .Run .Jobs = append (resp .State .Run .Jobs , & ViewJob {
116
118
ID : v .ID ,
Original file line number Diff line number Diff line change 2
2
<div class =" action-view-container" >
3
3
<div class =" action-view-header" >
4
4
<div class =" action-info-summary" >
5
- {{ run.title }}
5
+ <SvgIcon name =" octicon-check-circle-fill" size =" 20" class =" green" v-if =" run.status === 'success'" />
6
+ <SvgIcon name =" octicon-clock" size =" 20" class =" ui text yellow" v-else-if =" run.status === 'waiting'" />
7
+ <SvgIcon name =" octicon-meter" size =" 20" class =" ui text yellow" class-name =" job-status-rotate" v-else-if =" run.status === 'running'" />
8
+ <SvgIcon name =" octicon-x-circle-fill" size =" 20" class =" red" v-else />
9
+ <div class =" action-title" >
10
+ {{ run.title }}
11
+ </div >
6
12
<button class =" run_approve" @click =" approveRun()" v-if =" run.canApprove" >
7
13
<i class =" play circle outline icon" />
8
14
</button >
@@ -99,6 +105,7 @@ const sfc = {
99
105
run: {
100
106
link: ' ' ,
101
107
title: ' ' ,
108
+ status: ' ' ,
102
109
canCancel: false ,
103
110
canApprove: false ,
104
111
done: false ,
@@ -327,7 +334,11 @@ export function initRepositoryActionView() {
327
334
.action - info- summary {
328
335
font- size: 150 % ;
329
336
height: 20px ;
330
- padding: 0 10px ;
337
+ display: flex;
338
+
339
+ .action - title {
340
+ padding: 0 5px ;
341
+ }
331
342
}
332
343
333
344
// ================
You can’t perform that action at this time.
0 commit comments