Debug to status option (#1499)

* Let debug optionally target the status line (32 chars only)

* Add batching of messages to debug ws comms

* let Debug handle simple case of NaN

would also close #1530

* Fixup debug tests for batch comms (no new tests yet)

* mixup comms/api test to match new batch mode (no new tests)

* Add test for NaN being sent OK.

* redo original fix to padding / labels for new debug options

* fix debug test (re-add fix from #1444)

* Fix up merge issues in debug tests
This commit is contained in:
Dave Conway-Jones
2018-01-13 16:14:03 +00:00
committed by Nick O'Leary
parent 7bd8d8c3ae
commit 7b1787fdbb
9 changed files with 260 additions and 134 deletions

View File

@@ -439,7 +439,9 @@ RED.debug = (function() {
$('<span class="debug-message-name">'+name+'</span>').appendTo(metaRow);
}
if (format === 'Object' || /^array/.test(format) || format === 'boolean' || format === 'number' ) {
if ((format === 'number') && (payload === "NaN")) {
payload = Number.NaN;
} else if (format === 'Object' || /^array/.test(format) || format === 'boolean' || format === 'number' ) {
payload = JSON.parse(payload);
} else if (/error/i.test(format)) {
payload = JSON.parse(payload);