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
3 changed files with 21 additions and 1 deletions

View File

@@ -140,6 +140,8 @@ export class ExecutionDialog {
}).then((res) => { }).then((res) => {
if (res.ok) { if (res.ok) {
return res.json() return res.json()
} else if (res.status === 404) {
throw new Error('Execution not found: ' + executionTrackingId)
} else { } else {
throw new Error(res.statusText) throw new Error(res.statusText)
} }
@@ -147,6 +149,7 @@ export class ExecutionDialog {
).then((json) => { ).then((json) => {
this.renderExecutionResult(json) this.renderExecutionResult(json)
}).catch(err => { }).catch(err => {
console.log(err)
this.renderError(err) this.renderError(err)
}) })
} }
@@ -205,6 +208,6 @@ export class ExecutionDialog {
} }
renderError (err) { 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 return result
} }
function showExecutionResult (pathName) {
const executionTrackingId = pathName.split('/')[2]
window.executionDialog.fetchExecutionResult(executionTrackingId)
window.executionDialog.show()
}
function showSection (pathName) { function showSection (pathName) {
if (pathName.startsWith('/logs/')) {
showExecutionResult(pathName)
pushNewNavigationPath(pathName)
return
}
const path = window.registeredPaths.get(pathName) const path = window.registeredPaths.get(pathName)
if (path === undefined) { if (path === undefined) {
@@ -557,6 +569,7 @@ export function marshalLogsJsonToHtml (json) {
window.executionDialog.renderExecutionResult({ window.executionDialog.renderExecutionResult({
logEntry: window.logEntries[logEntry.executionTrackingId] logEntry: window.logEntries[logEntry.executionTrackingId]
}) })
pushNewNavigationPath('/logs/' + logEntry.executionTrackingId)
} }
for (const tag of logEntry.tags) { for (const tag of logEntry.tags) {

View File

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