|
14 | 14 | <button class="ui basic small compact button red" @click="cancelRun()" v-else-if="run.canCancel">
|
15 | 15 | {{ locale.cancel }}
|
16 | 16 | </button>
|
17 |
| - <button class="ui basic small compact button gt-mr-0" @click="rerun()" v-else-if="run.canRerun"> |
| 17 | + <button class="ui basic small compact button gt-mr-0 link-action" :data-url="`${run.link}/rerun`" v-else-if="run.canRerun"> |
18 | 18 | {{ locale.rerun_all }}
|
19 | 19 | </button>
|
20 | 20 | </div>
|
|
38 | 38 | <span class="job-brief-name gt-mx-3 gt-ellipsis">{{ job.name }}</span>
|
39 | 39 | </div>
|
40 | 40 | <span class="job-brief-item-right">
|
41 |
| - <SvgIcon name="octicon-sync" role="button" :data-tooltip-content="locale.rerun" class="job-brief-rerun gt-mx-3" @click="rerunJob(index)" v-if="job.canRerun && onHoverRerunIndex === job.id"/> |
| 41 | + <SvgIcon name="octicon-sync" role="button" :data-tooltip-content="locale.rerun" class="job-brief-rerun gt-mx-3 link-action" :data-url="`${run.link}/jobs/${index}/rerun`" v-if="job.canRerun && onHoverRerunIndex === job.id"/> |
42 | 42 | <span class="step-summary-duration">{{ job.duration }}</span>
|
43 | 43 | </span>
|
44 | 44 | </a>
|
@@ -126,7 +126,6 @@ import {createApp} from 'vue';
|
126 | 126 | import {toggleElem} from '../utils/dom.js';
|
127 | 127 | import {getCurrentLocale} from '../utils.js';
|
128 | 128 | import {renderAnsi} from '../render/ansi.js';
|
129 |
| -import {showErrorToast} from '../modules/toast.js'; |
130 | 129 |
|
131 | 130 | const {csrfToken} = window.config;
|
132 | 131 |
|
@@ -265,15 +264,6 @@ const sfc = {
|
265 | 264 | this.loadJob(); // try to load the data immediately instead of waiting for next timer interval
|
266 | 265 | }
|
267 | 266 | },
|
268 |
| - // rerun a job |
269 |
| - async rerunJob(idx) { |
270 |
| - const jobLink = `${this.run.link}/jobs/${idx}`; |
271 |
| - await this.fetchRerun(`${jobLink}/rerun`, jobLink); |
272 |
| - }, |
273 |
| - // rerun workflow |
274 |
| - async rerun() { |
275 |
| - await this.fetchRerun(`${this.run.link}/rerun`, this.run.link); |
276 |
| - }, |
277 | 267 | // cancel a run
|
278 | 268 | cancelRun() {
|
279 | 269 | this.fetchPost(`${this.run.link}/cancel`);
|
@@ -341,16 +331,6 @@ const sfc = {
|
341 | 331 | return await resp.json();
|
342 | 332 | },
|
343 | 333 |
|
344 |
| - async fetchRerun(url, hrefURL) { |
345 |
| - const resp = await this.fetchPost(url); |
346 |
| - const results = await resp.json(); |
347 |
| - if (results.errorMessage) { |
348 |
| - showErrorToast(results.errorMessage); |
349 |
| - } else { |
350 |
| - window.location.href = hrefURL; |
351 |
| - } |
352 |
| - }, |
353 |
| -
|
354 | 334 | async loadJob() {
|
355 | 335 | if (this.loading) return;
|
356 | 336 | try {
|
|
0 commit comments