mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-13 17:45:36 +00:00
feature: Link to log outputs (#415)
This commit is contained in:
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user