feature: Link to log outputs (#415)

This commit is contained in:
James Read 2024-10-02 01:17:09 +02:00 committed by GitHub
parent 9723a38ca1
commit c0a18f82a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 1 deletions

View File

@ -140,6 +140,8 @@ export class ExecutionDialog {
}).then((res) => {
if (res.ok) {
return res.json()
} else if (res.status === 404) {
throw new Error('Execution not found: ' + executionTrackingId)
} else {
throw new Error(res.statusText)
}
@ -147,6 +149,7 @@ export class ExecutionDialog {
).then((json) => {
this.renderExecutionResult(json)
}).catch(err => {
console.log(err)
this.renderError(err)
})
}
@ -205,6 +208,6 @@ export class ExecutionDialog {
}
renderError (err) {
this.dlg.querySelector('pre').innerText = JSON.stringify(err)
window.showBigError('execution-dlg-err', 'in the execution dialog', 'Failed to fetch execution result. ' + err, false)
}
}

View File

@ -124,7 +124,19 @@ function convertPathToBreadcrumb (path) {
return result
}
function showExecutionResult (pathName) {
const executionTrackingId = pathName.split('/')[2]
window.executionDialog.fetchExecutionResult(executionTrackingId)
window.executionDialog.show()
}
function showSection (pathName) {
if (pathName.startsWith('/logs/')) {
showExecutionResult(pathName)
pushNewNavigationPath(pathName)
return
}
const path = window.registeredPaths.get(pathName)
if (path === undefined) {
@ -557,6 +569,7 @@ export function marshalLogsJsonToHtml (json) {
window.executionDialog.renderExecutionResult({
logEntry: window.logEntries[logEntry.executionTrackingId]
})
pushNewNavigationPath('/logs/' + logEntry.executionTrackingId)
}
for (const tag of logEntry.tags) {

View File

@ -143,6 +143,10 @@ h1 {
flex-grow: 1;
}
dialog h1 {
padding-left: 0;
}
nav ul {
margin: 0;
padding: 0;