Updates to encode/decode message when passed over debug comms link

This commit is contained in:
Nick O'Leary 2021-05-13 13:38:34 +01:00
parent 001f066769
commit 4ff991764e
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 15 additions and 8 deletions

View File

@ -178,8 +178,14 @@ RED.utils = (function() {
RED.popover.tooltip(pinPath,RED._("node-red:debug.sidebar.pinPath")); RED.popover.tooltip(pinPath,RED._("node-red:debug.sidebar.pinPath"));
} }
if (extraTools) { if (extraTools) {
extraTools.addClass("red-ui-debug-msg-tools-other"); var t = extraTools;
extraTools.appendTo(tools); 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) { function checkExpanded(strippedKey,expandPaths,minRange,maxRange) {
@ -476,7 +482,8 @@ RED.utils = (function() {
rootPath: rootPath, rootPath: rootPath,
expandPaths: expandPaths, expandPaths: expandPaths,
ontoggle: ontoggle, ontoggle: ontoggle,
exposeApi: exposeApi exposeApi: exposeApi,
tools: tools
} }
).appendTo(row); ).appendTo(row);
} }
@ -504,8 +511,8 @@ RED.utils = (function() {
rootPath: rootPath, rootPath: rootPath,
expandPaths: expandPaths, expandPaths: expandPaths,
ontoggle: ontoggle, ontoggle: ontoggle,
exposeApi: exposeApi exposeApi: exposeApi,
tools: tools
} }
).appendTo(row); ).appendTo(row);
} }
@ -553,8 +560,8 @@ RED.utils = (function() {
rootPath: rootPath, rootPath: rootPath,
expandPaths: expandPaths, expandPaths: expandPaths,
ontoggle: ontoggle, ontoggle: ontoggle,
exposeApi: exposeApi exposeApi: exposeApi,
tools: tools
} }
).appendTo(row); ).appendTo(row);
} }

View File

@ -872,7 +872,7 @@ function encodeObject(msg,opts) {
} }
} }
return value; return value;
}," "); });
} else { } else {
try { msg.msg = msg.msg.toString(); } try { msg.msg = msg.msg.toString(); }
catch(e) { msg.msg = "[Type not printable]" + util.inspect(msg.msg); } catch(e) { msg.msg = "[Type not printable]" + util.inspect(msg.msg); }