-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add rerun workflow button and refactor to use SVG octicons #24350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
b736334
80a3542
d787f4e
2533591
109c728
b3a16e6
0808a4b
de43afd
aacf570
2de84d2
5cda868
c13600e
e7406d7
50c788e
0ce5416
4a1cc7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -6,11 +6,14 @@ | |||||||||
<div class="action-title"> | ||||||||||
{{ run.title }} | ||||||||||
</div> | ||||||||||
<button class="run_approve" @click="approveRun()" v-if="run.canApprove"> | ||||||||||
<i class="play circle outline icon"/> | ||||||||||
<button class="action-control-button text green" @click="approveRun()" v-if="run.canApprove"> | ||||||||||
<SvgIcon name="octicon-play" :size="20"/> | ||||||||||
</button> | ||||||||||
<button class="run_cancel" @click="cancelRun()" v-else-if="run.canCancel"> | ||||||||||
<i class="stop circle outline icon"/> | ||||||||||
<button class="action-control-button text red" @click="cancelRun()" v-else-if="run.canCancel"> | ||||||||||
<SvgIcon name="octicon-x-circle-fill" :size="20"/> | ||||||||||
</button> | ||||||||||
<button class="action-control-button text green" @click="rerun()" v-else-if="run.canRerun"> | ||||||||||
<SvgIcon name="octicon-sync" :size="20"/> | ||||||||||
</button> | ||||||||||
</div> | ||||||||||
<div class="action-commit-summary"> | ||||||||||
|
@@ -106,6 +109,7 @@ const sfc = { | |||||||||
status: '', | ||||||||||
canCancel: false, | ||||||||||
canApprove: false, | ||||||||||
canRerun: false, | ||||||||||
done: false, | ||||||||||
jobs: [ | ||||||||||
// { | ||||||||||
|
@@ -193,6 +197,11 @@ const sfc = { | |||||||||
await this.fetchPost(`${jobLink}/rerun`); | ||||||||||
window.location.href = jobLink; | ||||||||||
}, | ||||||||||
// rerun workflow | ||||||||||
rerun() { | ||||||||||
this.fetchPost(`${this.run.link}/jobs/-1/rerun`); | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is The -1 is used for "undefined" in many places. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IIRC, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wolfogre @wxiaoguang There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may misunderstood, I mean There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. gitea/routers/web/repo/actions/view.go Lines 379 to 382 in cf465b4
Maybe use global There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Convert into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this resolved? |
||||||||||
window.location.href = `${this.run.link}`; | ||||||||||
yp05327 marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
}, | ||||||||||
// cancel a run | ||||||||||
cancelRun() { | ||||||||||
this.fetchPost(`${this.run.link}/cancel`); | ||||||||||
|
@@ -366,26 +375,16 @@ export function ansiLogToHTML(line) { | |||||||||
margin: 0 20px 20px 20px; | ||||||||||
} | ||||||||||
|
||||||||||
.action-view-header .run_cancel { | ||||||||||
border: none; | ||||||||||
color: var(--color-red); | ||||||||||
background-color: transparent; | ||||||||||
outline: none; | ||||||||||
cursor: pointer; | ||||||||||
transition: transform 0.2s; | ||||||||||
} | ||||||||||
|
||||||||||
.action-view-header .run_approve { | ||||||||||
.action-view-header .action-control-button { | ||||||||||
border: none; | ||||||||||
color: var(--color-green); | ||||||||||
background-color: transparent; | ||||||||||
outline: none; | ||||||||||
cursor: pointer; | ||||||||||
transition: transform 0.2s; | ||||||||||
display: flex; | ||||||||||
} | ||||||||||
|
||||||||||
.action-view-header .run_cancel:hover, | ||||||||||
.action-view-header .run_approve:hover { | ||||||||||
.action-view-header .action-control-button:hover { | ||||||||||
transform: scale(130%); | ||||||||||
} | ||||||||||
|
||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.