File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -30,13 +30,11 @@ func View(ctx *context_module.Context) {
30
30
jobIndex := ctx .ParamsInt64 ("job" )
31
31
ctx .Data ["RunIndex" ] = runIndex
32
32
ctx .Data ["JobIndex" ] = jobIndex
33
+ ctx .Data ["ActionsURL" ] = ctx .Repo .RepoLink + "/actions"
33
34
34
- job , _ := getRunJobs (ctx , runIndex , jobIndex )
35
- if ctx .Written () {
35
+ if getRunJobs (ctx , runIndex , jobIndex ); ctx .Written () {
36
36
return
37
37
}
38
- run := job .Run
39
- ctx .Data ["Build" ] = run
40
38
41
39
ctx .HTML (http .StatusOK , tplViewActions )
42
40
}
Original file line number Diff line number Diff line change 2
2
3
3
<div class="page-content repository">
4
4
{{template "repo/header" .}}
5
- <div id="repo-action-view" data-run-index="{{.RunIndex}}" data-job-index="{{.JobIndex}}">
6
- </div>
7
-
5
+ <div id="repo-action-view" data-run-index="{{.RunIndex}}" data-job-index="{{.JobIndex}}" data-actions-url="{{.ActionsURL}}"></div>
8
6
</div>
9
7
10
8
{{template "base/footer" .}}
Original file line number Diff line number Diff line change @@ -78,6 +78,7 @@ const sfc = {
78
78
props: {
79
79
runIndex: Number ,
80
80
jobIndex: Number ,
81
+ actionsURL: String ,
81
82
},
82
83
83
84
data () {
@@ -214,7 +215,7 @@ const sfc = {
214
215
// * stateData: it will be stored into Vue data and used to update the UI state
215
216
// * logsData: the logs in it will be appended to the UI manually, no touch to Vue data
216
217
async fetchJobData (reqData ) {
217
- const resp = await fetch (` ` , {
218
+ const resp = await fetch (` ${ this . actionsURL } /runs/ ${ this . runIndex } /jobs/ ${ this . jobIndex } ` , {
218
219
method: ' POST' ,
219
220
headers: {
220
221
' Content-Type' : ' application/json' ,
@@ -271,8 +272,9 @@ export function initRepositoryActionView() {
271
272
if (! el) return ;
272
273
273
274
const view = createApp (sfc, {
274
- jobIndex: el .getAttribute (' data-job-index' ),
275
275
runIndex: el .getAttribute (' data-run-index' ),
276
+ jobIndex: el .getAttribute (' data-job-index' ),
277
+ actionsURL: el .getAttribute (' data-actions-url' ),
276
278
});
277
279
view .mount (el);
278
280
}
You can’t perform that action at this time.
0 commit comments