feature: Cleanup execution dialog, and log display status. (#378)

* feature: Cleanup execution dialog, and log display status.

* fmt: Remove empty block

* cicd: Use ActionStatusDisplay in test

* bugfix: missed promise

* bugfix: missed promise

* bugfix: Didnt return getText on ActionStatusDisplay
This commit is contained in:
James Read
2024-08-08 21:46:46 +01:00
committed by GitHub
parent 8d839ee6ce
commit fab0264d9b
6 changed files with 100 additions and 90 deletions

View File

@@ -2,6 +2,7 @@ import './ActionButton.js' // To define action-button
import { ExecutionDialog } from './ExecutionDialog.js'
import { Terminal } from '@xterm/xterm'
import { FitAddon } from '@xterm/addon-fit'
import { ActionStatusDisplay } from './ActionStatusDisplay.js'
/**
* This is a weird function that just sets some globals.
@@ -510,22 +511,14 @@ export function marshalLogsJsonToHtml (json) {
const tpl = document.getElementById('tplLogRow')
const row = tpl.content.querySelector('tr').cloneNode(true)
let logTableExitCode = logEntry.exitCode
if (logEntry.exitCode === 0) {
logTableExitCode = 'OK'
}
if (logEntry.timedOut) {
logTableExitCode += ' (timed out)'
}
row.querySelector('.timestamp').innerText = logEntry.datetimeStarted
row.querySelector('.content').innerText = logEntry.actionTitle
row.querySelector('.icon').innerHTML = logEntry.actionIcon
row.querySelector('.exit-code').innerText = logTableExitCode
row.setAttribute('title', logEntry.actionTitle)
const exitCodeDisplay = new ActionStatusDisplay(row.querySelector('.exit-code'))
exitCodeDisplay.update(logEntry)
row.querySelector('.content').onclick = () => {
window.executionDialog.reset()
window.executionDialog.show()