|
@@ -14,6 +14,8 @@ export class ExecutionDialog {
|
|
|
this.toggleSize()
|
|
this.toggleSize()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ this.domBtnKill = document.getElementById('execution-dialog-kill-action')
|
|
|
|
|
+
|
|
|
this.domDatetimeStarted = document.getElementById('execution-dialog-datetime-started')
|
|
this.domDatetimeStarted = document.getElementById('execution-dialog-datetime-started')
|
|
|
this.domDatetimeFinished = document.getElementById('execution-dialog-datetime-finished')
|
|
this.domDatetimeFinished = document.getElementById('execution-dialog-datetime-finished')
|
|
|
this.domExitCode = document.getElementById('execution-dialog-exit-code')
|
|
this.domExitCode = document.getElementById('execution-dialog-exit-code')
|
|
@@ -36,6 +38,7 @@ export class ExecutionDialog {
|
|
|
|
|
|
|
|
reset () {
|
|
reset () {
|
|
|
this.executionSeconds = 0
|
|
this.executionSeconds = 0
|
|
|
|
|
+ this.executionTrackingId = 'notset'
|
|
|
|
|
|
|
|
this.dlg.classList.remove('big')
|
|
this.dlg.classList.remove('big')
|
|
|
this.dlg.style.maxWidth = 'calc(100vw - 2em)'
|
|
this.dlg.style.maxWidth = 'calc(100vw - 2em)'
|
|
@@ -54,6 +57,9 @@ export class ExecutionDialog {
|
|
|
this.domStdout.innerText = ''
|
|
this.domStdout.innerText = ''
|
|
|
this.domStderr.innerText = ''
|
|
this.domStderr.innerText = ''
|
|
|
|
|
|
|
|
|
|
+ this.domBtnKill.disabled = true
|
|
|
|
|
+ this.domBtnKill.onclick = () => {}
|
|
|
|
|
+
|
|
|
this.hideDetailsOnResult = false
|
|
this.hideDetailsOnResult = false
|
|
|
this.domExecutionBasics.hidden = false
|
|
this.domExecutionBasics.hidden = false
|
|
|
|
|
|
|
@@ -68,6 +74,11 @@ export class ExecutionDialog {
|
|
|
this.domIcon.innerText = actionButton.domIcon.innerText
|
|
this.domIcon.innerText = actionButton.domIcon.innerText
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ this.domBtnKill.disabled = false
|
|
|
|
|
+ this.domBtnKill.onclick = () => {
|
|
|
|
|
+ this.killAction()
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
clearInterval(window.executionDialogTicker)
|
|
clearInterval(window.executionDialogTicker)
|
|
|
this.executionSeconds = 0
|
|
this.executionSeconds = 0
|
|
|
this.executionTick()
|
|
this.executionTick()
|
|
@@ -82,6 +93,24 @@ export class ExecutionDialog {
|
|
|
this.dlg.showModal()
|
|
this.dlg.showModal()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ killAction () {
|
|
|
|
|
+ const killActionArgs = {
|
|
|
|
|
+ executionTrackingId: this.executionTrackingId
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ window.fetch(window.restBaseUrl + 'KillAction', {
|
|
|
|
|
+ method: 'POST',
|
|
|
|
|
+ headers: {
|
|
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
|
|
+ },
|
|
|
|
|
+ body: JSON.stringify(killActionArgs)
|
|
|
|
|
+ }).then((res) => {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ }).catch(err => {
|
|
|
|
|
+ throw err
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
executionTick () {
|
|
executionTick () {
|
|
|
this.executionSeconds++
|
|
this.executionSeconds++
|
|
|
|
|
|
|
@@ -93,8 +122,8 @@ export class ExecutionDialog {
|
|
|
this.domExecutionBasics.hidden = true
|
|
this.domExecutionBasics.hidden = true
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- fetchExecutionResult (uuid) {
|
|
|
|
|
- this.executionTrackingId = uuid
|
|
|
|
|
|
|
+ fetchExecutionResult (executionTrackingId) {
|
|
|
|
|
+ this.executionTrackingId = executionTrackingId
|
|
|
|
|
|
|
|
const executionStatusArgs = {
|
|
const executionStatusArgs = {
|
|
|
executionTrackingId: this.executionTrackingId
|
|
executionTrackingId: this.executionTrackingId
|
|
@@ -133,6 +162,8 @@ export class ExecutionDialog {
|
|
|
|
|
|
|
|
this.executionTrackingId = res.logEntry.executionTrackingId
|
|
this.executionTrackingId = res.logEntry.executionTrackingId
|
|
|
|
|
|
|
|
|
|
+ this.domBtnKill.disabled = res.logEntry.executionFinished
|
|
|
|
|
+
|
|
|
if (res.logEntry.executionFinished) {
|
|
if (res.logEntry.executionFinished) {
|
|
|
this.domStatus.innerText = 'Completed'
|
|
this.domStatus.innerText = 'Completed'
|
|
|
this.domStatus.classList.add('action-success')
|
|
this.domStatus.classList.add('action-success')
|