aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2023-02-01 06:46:10 +0800
committerGitHub <noreply@github.com>2023-01-31 22:46:10 +0000
commitb6145bfaa348cb90364837a0fa86421d26f93463 (patch)
tree7d8afb04597ab4e698f6d2937d5786a67f00b7b7
parent707ecec71514fbadb09bdbe915129a9badf0755c (diff)
downloadgitea-b6145bfaa348cb90364837a0fa86421d26f93463.tar.gz
gitea-b6145bfaa348cb90364837a0fa86421d26f93463.zip
Use relative url in actions view (#22675)
Use relative url in actions view.
-rw-r--r--routers/web/repo/actions/view.go4
-rw-r--r--web_src/js/components/RepoActionView.vue8
2 files changed, 6 insertions, 6 deletions
diff --git a/routers/web/repo/actions/view.go b/routers/web/repo/actions/view.go
index e83494f64a..5370310e8d 100644
--- a/routers/web/repo/actions/view.go
+++ b/routers/web/repo/actions/view.go
@@ -49,7 +49,7 @@ type ViewRequest struct {
type ViewResponse struct {
State struct {
Run struct {
- HTMLURL string `json:"htmlurl"`
+ Link string `json:"link"`
Title string `json:"title"`
CanCancel bool `json:"canCancel"`
Done bool `json:"done"`
@@ -105,7 +105,7 @@ func ViewPost(ctx *context_module.Context) {
resp := &ViewResponse{}
resp.State.Run.Title = run.Title
- resp.State.Run.HTMLURL = run.HTMLURL()
+ resp.State.Run.Link = run.Link()
resp.State.Run.CanCancel = !run.Status.IsDone() && 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
diff --git a/web_src/js/components/RepoActionView.vue b/web_src/js/components/RepoActionView.vue
index 673e5b0d8c..4c7408d1b3 100644
--- a/web_src/js/components/RepoActionView.vue
+++ b/web_src/js/components/RepoActionView.vue
@@ -12,7 +12,7 @@
<div class="action-view-left">
<div class="job-group-section">
<div class="job-brief-list">
- <a class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id" :href="run.htmlurl+'/jobs/'+index">
+ <a class="job-brief-item" v-for="(job, index) in run.jobs" :key="job.id" :href="run.link+'/jobs/'+index">
<SvgIcon name="octicon-check-circle-fill" class="green" v-if="job.status === 'success'"/>
<SvgIcon name="octicon-skip" class="ui text grey" v-else-if="job.status === 'skipped'"/>
<SvgIcon name="octicon-clock" class="ui text yellow" v-else-if="job.status === 'waiting'"/>
@@ -92,7 +92,7 @@ const sfc = {
// provided by backend
run: {
- htmlurl: '',
+ link: '',
title: '',
canCancel: false,
done: false,
@@ -163,11 +163,11 @@ const sfc = {
},
// rerun a job
rerunJob(idx) {
- this.fetch(`${this.run.htmlurl}/jobs/${idx}/rerun`);
+ this.fetch(`${this.run.link}/jobs/${idx}/rerun`);
},
// cancel a run
cancelRun() {
- this.fetch(`${this.run.htmlurl}/cancel`);
+ this.fetch(`${this.run.link}/cancel`);
},
createLogLine(line) {