diff --git a/service/internal/config/sanitize.go b/service/internal/config/sanitize.go
index 644fc17..2a93759 100644
--- a/service/internal/config/sanitize.go
+++ b/service/internal/config/sanitize.go
@@ -77,10 +77,13 @@ func getActionID(action *Action) string {
return action.ID
}
+//gocyclo:ignore
func sanitizePopupOnStart(raw string, cfg *Config) string {
switch raw {
case "execution-dialog":
return raw
+ case "execution-dialog-output-html":
+ return raw
case "execution-dialog-stdout-only":
return raw
case "execution-button":
diff --git a/webui.dev/index.html b/webui.dev/index.html
index bb38eda..485a3ca 100644
--- a/webui.dev/index.html
+++ b/webui.dev/index.html
@@ -153,6 +153,7 @@
+
diff --git a/webui.dev/js/ExecutionDialog.js b/webui.dev/js/ExecutionDialog.js
index 4fef223..2e40af1 100644
--- a/webui.dev/js/ExecutionDialog.js
+++ b/webui.dev/js/ExecutionDialog.js
@@ -11,6 +11,7 @@ export class ExecutionDialog {
this.domIcon = document.getElementById('execution-dialog-icon')
this.domTitle = document.getElementById('execution-dialog-title')
this.domOutput = document.getElementById('execution-dialog-xterm')
+ this.domOutputHtml = document.getElementById('execution-dialog-output-html')
this.domOutputToggleBig = document.getElementById('execution-dialog-toggle-size')
this.domOutputToggleBig.onclick = () => {
this.toggleSize()
@@ -197,7 +198,17 @@ export class ExecutionDialog {
clearInterval(window.executionDialogTicker)
- this.domOutput.hidden = false
+ if ("type" in res && res.type == "execution-dialog-output-html") {
+ this.domOutputHtml.hidden = false
+ this.domOutput.hidden = true
+ this.domOutputHtml.innerHTML = res.logEntry.output
+ this.domOutputHtml.hidden = false
+ this.hideDetailsonResult = true
+ } else {
+ this.domOutput.hidden = false
+ this.domOutputHtml.innerHTML = ''
+ this.domOutputHtml.hidden = true
+ }
if (this.hideDetailsOnResult) {
this.domExecutionDetails.hidden = true
@@ -218,6 +229,7 @@ export class ExecutionDialog {
this.updateDuration(res.logEntry)
+
window.terminal.reset()
window.terminal.write(res.logEntry.output, () => {
window.terminal.fit()
diff --git a/webui.dev/js/marshaller.js b/webui.dev/js/marshaller.js
index 281635d..9ebd112 100644
--- a/webui.dev/js/marshaller.js
+++ b/webui.dev/js/marshaller.js
@@ -158,28 +158,31 @@ function onExecutionFinished (evt) {
return
}
+ let feedbackButton = actionButton;
+
switch (actionButton.popupOnStart) {
case 'execution-button':
- if (document.querySelector('execution-button#execution-' + logEntry.executionTrackingId) !== null) { // If the button was created in our instance
- document.querySelector('execution-button#execution-' + logEntry.executionTrackingId).onExecutionFinished(logEntry)
- }
+ let executionButton = document.querySelector('execution-button#execution-' + logEntry.executionTrackingId)
+
+ if (executionButton != null) {
+ feedbackButton = executionButton
+ }
+
break
+ case 'execution-dialog-output-html':
case 'execution-dialog-stdout-only':
case 'execution-dialog':
- actionButton.onExecutionFinished(logEntry)
-
// We don't need to fetch the logEntry for the dialog because we already
// have it, so we open the dialog and it will get updated below.
window.executionDialog.show()
window.executionDialog.executionTrackingId = logEntry.uuid
- break
- default:
- actionButton.onExecutionFinished(logEntry)
break
}
+ feedbackButton.onExecutionFinished(logEntry)
+
marshalLogsJsonToHtml({
logs: [logEntry]
})
@@ -187,7 +190,8 @@ function onExecutionFinished (evt) {
// If the current execution dialog is open, update that too
if (window.executionDialog.dlg.open && window.executionDialog.executionUuid === logEntry.uuid) {
window.executionDialog.renderExecutionResult({
- logEntry: logEntry
+ logEntry: logEntry,
+ type: actionButton.popupOnStart,
})
}
}