Skip to content

Commit b6145bf

Browse files
authored
Use relative url in actions view (#22675)
Use relative url in actions view.
1 parent 707ecec commit b6145bf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

routers/web/repo/actions/view.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ type ViewRequest struct {
4949
type ViewResponse struct {
5050
State struct {
5151
Run struct {
52-
HTMLURL string `json:"htmlurl"`
52+
Link string `json:"link"`
5353
Title string `json:"title"`
5454
CanCancel bool `json:"canCancel"`
5555
Done bool `json:"done"`
@@ -105,7 +105,7 @@ func ViewPost(ctx *context_module.Context) {
105105
resp := &ViewResponse{}
106106

107107
resp.State.Run.Title = run.Title
108-
resp.State.Run.HTMLURL = run.HTMLURL()
108+
resp.State.Run.Link = run.Link()
109109
resp.State.Run.CanCancel = !run.Status.IsDone() && ctx.Repo.CanWrite(unit.TypeActions)
110110
resp.State.Run.Done = run.Status.IsDone()
111111
resp.State.Run.Jobs = make([]*ViewJob, 0, len(jobs)) // marshal to '[]' instead fo 'null' in json

web_src/js/components/RepoActionView.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div class="action-view-left">
1313
<div class="job-group-section">
1414
<div class="job-brief-list">
15-
<a class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id" :href="run.htmlurl+'/jobs/'+index">
15+
<a class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id" :href="run.link+'/jobs/'+index">
1616
<SvgIcon name="octicon-check-circle-fill" class="green" v-if="job.status === 'success'"/>
1717
<SvgIcon name="octicon-skip" class="ui text grey" v-else-if="job.status === 'skipped'"/>
1818
<SvgIcon name="octicon-clock" class="ui text yellow" v-else-if="job.status === 'waiting'"/>
@@ -92,7 +92,7 @@ const sfc = {
9292
9393
// provided by backend
9494
run: {
95-
htmlurl: '',
95+
link: '',
9696
title: '',
9797
canCancel: false,
9898
done: false,
@@ -163,11 +163,11 @@ const sfc = {
163163
},
164164
// rerun a job
165165
rerunJob(idx) {
166-
this.fetch(`${this.run.htmlurl}/jobs/${idx}/rerun`);
166+
this.fetch(`${this.run.link}/jobs/${idx}/rerun`);
167167
},
168168
// cancel a run
169169
cancelRun() {
170-
this.fetch(`${this.run.htmlurl}/cancel`);
170+
this.fetch(`${this.run.link}/cancel`);
171171
},
172172
173173
createLogLine(line) {

0 commit comments

Comments
 (0)