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
2 changed files with 19 additions and 2 deletions

View File

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