Skip to content

Commit c8d9303

Browse files
committed
fixed client
1 parent 41d1494 commit c8d9303

File tree

1 file changed

+0
-38
lines changed

1 file changed

+0
-38
lines changed

src/html_src/index.js

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,5 @@
11
window.lastLogLineCount = window.lastLogLineCount || {};
22

3-
// --- Raw WebSocket Message Log UI ---
4-
$(document).ready(function () {
5-
// Add a raw message log panel to the body
6-
const rawLogPanel = $(`
7-
<div id="rawMessageLogPanel" style="position:fixed;bottom:0;right:0;width:420px;height:200px;z-index:9999;background:rgba(20,20,20,0.97);color:#eee;font-family:monospace;font-size:12px;overflow:auto;border-top-left-radius:8px;border:1px solid #444;box-shadow:0 0 8px #000;">
8-
<div style="padding:2px 8px;background:#222;border-top-left-radius:8px;border-bottom:1px solid #444;display:flex;align-items:center;">
9-
<span style="flex:1;">Raw WebSocket Log</span>
10-
<button id="clearRawLog" style="background:#444;color:#eee;border:none;border-radius:4px;padding:2px 8px;cursor:pointer;">Clear</button>
11-
</div>
12-
<div id="rawMessageLog" style="height:170px;overflow:auto;padding:4px;"></div>
13-
</div>
14-
`);
15-
$("body").append(rawLogPanel);
16-
$("#clearRawLog").click(function () {
17-
$("#rawMessageLog").empty();
18-
});
19-
});
20-
213
function closeMenu() {
224
$("#menu").animate(
235
{
@@ -582,26 +564,6 @@ $(document).ready(function () {
582564
});
583565

584566
socket.onmessage = function (message) {
585-
// Log the raw message for debugging
586-
if (typeof message.data === "string") {
587-
console.log("[WS RAW] (text):", message.data);
588-
} else if (message.data instanceof ArrayBuffer) {
589-
// Show as hex and as decoded MessagePack (if possible)
590-
const arr = new Uint8Array(message.data);
591-
const hex = Array.from(arr)
592-
.map((b) => b.toString(16).padStart(2, "0"))
593-
.join(" ");
594-
console.log("[WS RAW] (binary, hex):", hex);
595-
try {
596-
const decoded = window.MessagePack.decode(arr);
597-
console.log("[WS RAW] (MessagePack decoded):", decoded);
598-
} catch (e) {
599-
console.log("[WS RAW] (MessagePack decode error):", e);
600-
}
601-
} else {
602-
console.log("[WS RAW] (unknown type):", message.data);
603-
}
604-
605567
let obj;
606568
if (typeof message.data === "string") {
607569
obj = JSON.parse(message.data);

0 commit comments

Comments
 (0)