diff --git a/webui.dev/js/ExecutionDialog.js b/webui.dev/js/ExecutionDialog.js index 12c081a..2fa6064 100644 --- a/webui.dev/js/ExecutionDialog.js +++ b/webui.dev/js/ExecutionDialog.js @@ -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) } } diff --git a/webui.dev/js/marshaller.js b/webui.dev/js/marshaller.js index e8a0673..5f24441 100644 --- a/webui.dev/js/marshaller.js +++ b/webui.dev/js/marshaller.js @@ -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) { diff --git a/webui.dev/style.css b/webui.dev/style.css index f0866a6..02792b6 100644 --- a/webui.dev/style.css +++ b/webui.dev/style.css @@ -143,6 +143,10 @@ h1 { flex-grow: 1; } +dialog h1 { + padding-left: 0; +} + nav ul { margin: 0; padding: 0;