Skip to content

Commit 03f8a14

Browse files
author
Stefania
committed
fix string interpolation
1 parent 95c735d commit 03f8a14

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

home.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
if (jsonMsg.Ports) {
3535
const validKeys = ['Name', 'SerialNumber', 'IsOpen', 'VendorID', 'ProductID'];
3636
if (jsonMsg.Network) {
37-
printMsg = `<b>Network Ports</b>:<br>${JSON.stringify(jsonMsg.Ports, validKeys, 2)}`
37+
printMsg = "<b>Network Ports</b>:<br>"+JSON.stringify(jsonMsg.Ports, validKeys, 2);
3838
} else {
39-
printMsg = `<b>Serial Ports</b>:<br>${JSON.stringify(jsonMsg.Ports, validKeys, 2)}`
39+
printMsg = "<b>Serial Ports</b>:<br>"+JSON.stringify(jsonMsg.Ports, validKeys, 2);
4040
}
4141
} else if (Object.keys(jsonMsg).length !== 0) {
42-
printMsg = `${JSON.stringify(jsonMsg, undefined, 2)}`;
42+
printMsg = JSON.stringify(jsonMsg, undefined, 2);
4343
}
4444
messages.push(printMsg);
4545
if (messages.length > MESSAGES_MAX_COUNT) {
@@ -50,7 +50,6 @@
5050
log.scrollTop = log.scrollHeight - log.clientHeight;
5151
}
5252
}
53-
5453
}
5554

5655
$('#form').submit(function(e) {

main.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,12 @@ const homeTemplateHtml = `<!DOCTYPE html>
446446
if (jsonMsg.Ports) {
447447
const validKeys = ['Name', 'SerialNumber', 'IsOpen', 'VendorID', 'ProductID'];
448448
if (jsonMsg.Network) {
449-
printMsg = "<b>Network Ports</b>:<br>${JSON.stringify(jsonMsg.Ports, validKeys, 2)}"
449+
printMsg = "<b>Network Ports</b>:<br>"+JSON.stringify(jsonMsg.Ports, validKeys, 2);
450450
} else {
451-
printMsg = "<b>Serial Ports</b>:<br>${JSON.stringify(jsonMsg.Ports, validKeys, 2)}"
451+
printMsg = "<b>Serial Ports</b>:<br>"+JSON.stringify(jsonMsg.Ports, validKeys, 2);
452452
}
453453
} else if (Object.keys(jsonMsg).length !== 0) {
454-
printMsg = "${JSON.stringify(jsonMsg, undefined, 2)}";
454+
printMsg = JSON.stringify(jsonMsg, undefined, 2);
455455
}
456456
messages.push(printMsg);
457457
if (messages.length > MESSAGES_MAX_COUNT) {
@@ -462,7 +462,6 @@ const homeTemplateHtml = `<!DOCTYPE html>
462462
log.scrollTop = log.scrollHeight - log.clientHeight;
463463
}
464464
}
465-
466465
}
467466
468467
$('#form').submit(function(e) {

0 commit comments

Comments
 (0)