From 4ff991764e313e3077c978c3157c7a986abbb14d Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 13 May 2021 13:38:34 +0100 Subject: [PATCH] Updates to encode/decode message when passed over debug comms link --- .../editor-client/src/js/ui/utils.js | 21 ++++++++++++------- .../node_modules/@node-red/util/lib/util.js | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js index bb17ea395..038754c7d 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/utils.js @@ -178,8 +178,14 @@ RED.utils = (function() { RED.popover.tooltip(pinPath,RED._("node-red:debug.sidebar.pinPath")); } if (extraTools) { - extraTools.addClass("red-ui-debug-msg-tools-other"); - extraTools.appendTo(tools); + var t = extraTools; + if (typeof t === 'function') { + t = t(key,msg); + } + if (t) { + t.addClass("red-ui-debug-msg-tools-other"); + t.appendTo(tools); + } } } function checkExpanded(strippedKey,expandPaths,minRange,maxRange) { @@ -476,7 +482,8 @@ RED.utils = (function() { rootPath: rootPath, expandPaths: expandPaths, ontoggle: ontoggle, - exposeApi: exposeApi + exposeApi: exposeApi, + tools: tools } ).appendTo(row); } @@ -504,8 +511,8 @@ RED.utils = (function() { rootPath: rootPath, expandPaths: expandPaths, ontoggle: ontoggle, - exposeApi: exposeApi - + exposeApi: exposeApi, + tools: tools } ).appendTo(row); } @@ -553,8 +560,8 @@ RED.utils = (function() { rootPath: rootPath, expandPaths: expandPaths, ontoggle: ontoggle, - exposeApi: exposeApi - + exposeApi: exposeApi, + tools: tools } ).appendTo(row); } diff --git a/packages/node_modules/@node-red/util/lib/util.js b/packages/node_modules/@node-red/util/lib/util.js index 54da6b1f9..fc9e69acb 100644 --- a/packages/node_modules/@node-red/util/lib/util.js +++ b/packages/node_modules/@node-red/util/lib/util.js @@ -872,7 +872,7 @@ function encodeObject(msg,opts) { } } return value; - }," "); + }); } else { try { msg.msg = msg.msg.toString(); } catch(e) { msg.msg = "[Type not printable]" + util.inspect(msg.msg); }