feature: Popup execution dialog from logs

This commit is contained in:
jamesread 2024-02-23 23:52:41 +00:00
parent 42535feadf
commit 58cc04298f
5 changed files with 18 additions and 10 deletions

View File

@ -162,7 +162,7 @@
<td class = "timestamp">?</td> <td class = "timestamp">?</td>
<td> <td>
<span role = "img" class = "icon"></span> <span role = "img" class = "icon"></span>
<span class = "content">?</span> <a href = "#" class = "content">?</a>
<details> <details>
<summary>stdout</summary> <summary>stdout</summary>

View File

@ -103,7 +103,7 @@ class ActionButton extends ExecutionFeedbackButton {
uniqueTrackingId: this.getUniqueId() uniqueTrackingId: this.getUniqueId()
} }
this.onActionStarted(startActionArgs.uuid) this.onActionStarted(startActionArgs.uniqueTrackingId)
window.fetch(window.restBaseUrl + 'StartAction', { window.fetch(window.restBaseUrl + 'StartAction', {
method: 'POST', method: 'POST',
@ -125,10 +125,10 @@ class ActionButton extends ExecutionFeedbackButton {
}) })
} }
onActionStarted (executionUuid) { onActionStarted (executionTrackingId) {
if (this.popupOnStart === 'execution-button') { if (this.popupOnStart === 'execution-button') {
const btnExecution = document.createElement('execution-button') const btnExecution = document.createElement('execution-button')
btnExecution.constructFromJson(executionUuid) btnExecution.constructFromJson(executionTrackingId)
this.querySelector('.action-button-footer').prepend(btnExecution) this.querySelector('.action-button-footer').prepend(btnExecution)
return return

View File

@ -2,7 +2,7 @@ import { ExecutionFeedbackButton } from './ExecutionFeedbackButton.js'
class ExecutionButton extends ExecutionFeedbackButton { class ExecutionButton extends ExecutionFeedbackButton {
constructFromJson (json) { constructFromJson (json) {
this.executionUuid = json this.executionTrackingId = json
this.ellapsed = 0 this.ellapsed = 0
this.appendChild(document.createElement('button')) this.appendChild(document.createElement('button'))
@ -22,7 +22,7 @@ class ExecutionButton extends ExecutionFeedbackButton {
show () { show () {
window.executionDialog.reset() window.executionDialog.reset()
window.executionDialog.show() window.executionDialog.show()
window.executionDialog.fetchExecutionResult(this.executionUuid) window.executionDialog.fetchExecutionResult(this.executionTrackingId)
} }
onExecStatusChanged () { onExecStatusChanged () {

View File

@ -90,10 +90,10 @@ export class ExecutionDialog {
} }
fetchExecutionResult (uuid) { fetchExecutionResult (uuid) {
this.executionUuid = uuid this.executionTrackingId = uuid
const executionStatusArgs = { const executionStatusArgs = {
executionUuid: this.executionUuid executionTrackingId: this.executionTrackingId
} }
window.fetch(window.restBaseUrl + 'ExecutionStatus', { window.fetch(window.restBaseUrl + 'ExecutionStatus', {
@ -127,7 +127,7 @@ export class ExecutionDialog {
this.domStdout.parentElement.open = true this.domStdout.parentElement.open = true
} }
this.executionUuid = res.logEntry.executionUuid this.executionTrackingId = res.logEntry.executionTrackingId
if (res.logEntry.executionFinished) { if (res.logEntry.executionFinished) {
this.domStatus.innerText = 'Completed' this.domStatus.innerText = 'Completed'

View File

@ -56,7 +56,7 @@ function onExecutionFinished (evt) {
switch (actionButton.popupOnStart) { switch (actionButton.popupOnStart) {
case 'execution-button': case 'execution-button':
document.querySelector('execution-button#execution-' + logEntry.uuid).onExecutionFinished(logEntry) document.querySelector('execution-button#execution-' + logEntry.executionTrackingId).onExecutionFinished(logEntry)
break break
case 'execution-dialog-stdout-only': case 'execution-dialog-stdout-only':
case 'execution-dialog': case 'execution-dialog':
@ -414,6 +414,14 @@ export function marshalLogsJsonToHtml (json) {
row.querySelector('.exit-code').innerText = logTableExitCode row.querySelector('.exit-code').innerText = logTableExitCode
row.setAttribute('title', logEntry.actionTitle) row.setAttribute('title', logEntry.actionTitle)
row.querySelector('.content').onclick = () => {
window.executionDialog.reset()
window.executionDialog.show()
window.executionDialog.renderExecutionResult({
logEntry: window.logEntries[logEntry.executionTrackingId]
})
}
for (const tag of logEntry.tags) { for (const tag of logEntry.tags) {
const domTag = document.createElement('span') const domTag = document.createElement('span')
domTag.classList.add('tag') domTag.classList.add('tag')