From d3fba38214ffc204fb02afdc74657b95c2722bfe Mon Sep 17 00:00:00 2001 From: Private Island Networks Date: Wed, 22 Apr 2026 12:00:41 -0400 Subject: mle: fix up various issues with formatting and messages so messages appear in the ML tab --- static/js/base.js | 2 +- static/js/ws.js | 26 ++++++-------------------- 2 files changed, 7 insertions(+), 21 deletions(-) (limited to 'static/js') diff --git a/static/js/base.js b/static/js/base.js index 2920c25..f3d74d2 100644 --- a/static/js/base.js +++ b/static/js/base.js @@ -38,7 +38,7 @@ const PORT_PHY1 = 1; const PORT_PHY2 = 2; const PORT_PC = 10; -const MSG_FORMAT_BASIC = 0; +const MSG_FORMAT_INFO = 0; const MSG_FORMAT_CONTROLLER = 1; const MSG_FORMAT_MLE = 2; diff --git a/static/js/ws.js b/static/js/ws.js index bc814ff..664c729 100644 --- a/static/js/ws.js +++ b/static/js/ws.js @@ -73,7 +73,7 @@ socket.onmessage = function(event) { let num_msgs = 0; let msg = JSON.parse(event.data); - if (msg.format == MSG_FORMAT_BASIC) { + if (msg.format == MSG_FORMAT_INFO) { if (typeof msg['mode'] !== "undefined") { console.log("mode: ", msg['mode']); update_mode(msg['mode']); @@ -102,26 +102,12 @@ socket.onmessage = function(event) { } num_msgs += 1; - console.log("From server:", num_msgs, ': ', msg); + console.log("From server:", msg.data.substring(0,48)); - if (msg.port == PORT_PC) { - log.innerHTML += '
' + msg.time + '
' + - '
' + log_msg(msg) + '
' + - '
' + - '
'; - } - else if (msg.port == PORT_PHY0) { - log.innerHTML += '
' + msg.time + '
' + - '
' + - '
' + log_msg(msg) + - '
'; - } - else if (msg.port == PORT_PHY1) { - log.innerHTML += '
' + msg.time + '
' + - '
' + - '
' + - '
' + log_msg(msg) + '
'; - } + log.innerHTML += '
' + msg.time + '
' + + '
' + msg.token + '
' + + '
' + msg.data.substring(0,48) + '
' + + '
'; // socket.send("request"); state = "Request" -- cgit v1.2.3-8-gadcc