✨ Add functionality to send console.log messages to editor-UI (#1816)
* ✨ Send console.log messages to editor-UI * ⚡ Send message only to session which started workflow * ⚡ Made it also work in own process * ⚡ Add support for console.log UI forward also to FunctionItem Node * 👕 Fix lint issue * 👕 Fix linting issue * ⚡ Improve code Co-authored-by: Iván Ovejero <ivov.src@gmail.com> Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
@@ -749,6 +749,18 @@ export function getExecuteFunctions(workflow: Workflow, runExecutionData: IRunEx
|
||||
return workflow.getStaticData(type, node);
|
||||
},
|
||||
prepareOutputData: NodeHelpers.prepareOutputData,
|
||||
sendMessageToUI(message: string): void {
|
||||
if (mode !== 'manual') {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (additionalData.sendMessageToUI) {
|
||||
additionalData.sendMessageToUI(node.name, message);
|
||||
}
|
||||
} catch (error) {
|
||||
Logger.warn(`There was a problem sending messsage to UI: ${error.message}`);
|
||||
}
|
||||
},
|
||||
helpers: {
|
||||
prepareBinaryData,
|
||||
request: requestPromiseWithDefaults,
|
||||
|
||||
@@ -752,6 +752,7 @@ export function WorkflowExecuteAdditionalData(waitPromise: IDeferredPromise<IRun
|
||||
credentialsHelper: new CredentialsHelper({}, ''),
|
||||
hooks: new WorkflowHooks(hookFunctions, 'trigger', '1', workflowData),
|
||||
executeWorkflow: async (workflowInfo: IExecuteWorkflowInfo): Promise<any> => {}, // tslint:disable-line:no-any
|
||||
sendMessageToUI: (message: string) => {},
|
||||
restApiUrl: '',
|
||||
encryptionKey: 'test',
|
||||
timezone: 'America/New_York',
|
||||
|
||||
Reference in New Issue
Block a user