feature: Rerun button on execution dialog, easily rerun actions! (#465)

This commit is contained in:
James Read 2024-11-01 20:49:45 +00:00 committed by GitHub
parent ceb0a78180
commit 964dc7b48a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 2 deletions

View File

@ -146,6 +146,7 @@
<div id = "execution-dialog-xterm"></div> <div id = "execution-dialog-xterm"></div>
<div class = "buttons padded-content"> <div class = "buttons padded-content">
<button name = "rerun" title = "Rerun" id = "execution-dialog-rerun-action">Rerun</button>
<button name = "kill" title = "Kill" id = "execution-dialog-kill-action">Kill</button> <button name = "kill" title = "Kill" id = "execution-dialog-kill-action">Kill</button>
<form method = "dialog"> <form method = "dialog">

View File

@ -16,6 +16,7 @@ export class ExecutionDialog {
this.toggleSize() this.toggleSize()
} }
this.domBtnRerun = document.getElementById('execution-dialog-rerun-action')
this.domBtnKill = document.getElementById('execution-dialog-kill-action') this.domBtnKill = document.getElementById('execution-dialog-kill-action')
this.domDuration = document.getElementById('execution-dialog-duration') this.domDuration = document.getElementById('execution-dialog-duration')
@ -57,6 +58,8 @@ export class ExecutionDialog {
// window.terminal.close() // window.terminal.close()
this.domBtnRerun.disabled = true
this.domBtnRerun.onclick = () => {}
this.domBtnKill.disabled = true this.domBtnKill.disabled = true
this.domBtnKill.onclick = () => {} this.domBtnKill.onclick = () => {}
@ -93,6 +96,16 @@ export class ExecutionDialog {
this.dlg.showModal() this.dlg.showModal()
} }
rerunAction (actionId) {
const actionButton = document.getElementById('actionButton-' + actionId)
if (actionButton !== undefined) {
actionButton.btn.click()
}
this.dlg.close()
}
killAction () { killAction () {
const killActionArgs = { const killActionArgs = {
executionTrackingId: this.executionTrackingId executionTrackingId: this.executionTrackingId
@ -186,12 +199,15 @@ export class ExecutionDialog {
this.domOutput.hidden = false this.domOutput.hidden = false
if (!this.hideDetailsOnResult) { if (this.hideDetailsOnResult) {
this.domExecutionDetails.hidden = false this.domExecutionDetails.hidden = true
} }
this.executionTrackingId = res.logEntry.executionTrackingId this.executionTrackingId = res.logEntry.executionTrackingId
this.domBtnRerun.disabled = !res.logEntry.executionFinished
this.domBtnRerun.onclick = () => { this.rerunAction(res.logEntry.actionId) }
this.domBtnKill.disabled = res.logEntry.executionFinished this.domBtnKill.disabled = res.logEntry.executionFinished
this.domStatus.update(res.logEntry) this.domStatus.update(res.logEntry)