From 104db8830e432cf540a1990008a1c4d6656c929d Mon Sep 17 00:00:00 2001
From: Mashintime
Date: Wed, 5 Jul 2023 16:43:56 +0000
Subject: [PATCH] Prettified Code!
---
gui/daemon.js | 6 +-
gui/main.js | 15 ++-
gui/preload-chat.js | 83 ++++++++-------
gui/preload-log.js | 2 +-
gui/preload-main.js | 201 ++++++++++++++++-------------------
gui/preload-mesh.js | 222 ++++++++++++++++++---------------------
gui/sock.js | 22 ++--
gui/src/chat-module.html | 2 +-
gui/src/data-module.html | 2 +-
gui/src/index.html | 38 ++++---
gui/src/log-module.html | 2 +-
gui/src/mesh-module.html | 39 ++++---
gui/src/splash.html | 2 +-
13 files changed, 308 insertions(+), 328 deletions(-)
diff --git a/gui/daemon.js b/gui/daemon.js
index 77c2cec4..6d9c6f25 100644
--- a/gui/daemon.js
+++ b/gui/daemon.js
@@ -228,7 +228,7 @@ exports.startTNC = function (
tx_delay,
tci_ip,
tci_port,
- enable_mesh
+ enable_mesh,
) {
var json_command = JSON.stringify({
type: "set",
@@ -265,7 +265,7 @@ exports.startTNC = function (
tx_delay: tx_delay,
tci_ip: tci_ip,
tci_port: tci_port,
- enable_mesh: enable_mesh
+ enable_mesh: enable_mesh,
},
],
});
@@ -292,7 +292,7 @@ exports.testHamlib = function (
stop_bits,
handshake,
rigctld_ip,
- rigctld_port
+ rigctld_port,
) {
var json_command = JSON.stringify({
type: "get",
diff --git a/gui/main.js b/gui/main.js
index 03ea87fd..75a97f01 100644
--- a/gui/main.js
+++ b/gui/main.js
@@ -331,7 +331,7 @@ app.whenReady().then(() => {
daemonPath = path.join(
process.resourcesPath,
"tnc",
- "freedata-daemon.exe"
+ "freedata-daemon.exe",
);
break;
default:
@@ -433,7 +433,7 @@ ipcMain.on("request-update-daemon-ip", (event, data) => {
ipcMain.on("request-update-tnc-state", (event, arg) => {
win.webContents.send("action-update-tnc-state", arg);
- meshViewer.send("action-update-mesh-table", arg)
+ meshViewer.send("action-update-mesh-table", arg);
//data.webContents.send('action-update-tnc-state', arg);
});
@@ -517,7 +517,6 @@ ipcMain.on("request-open-mesh-module", () => {
meshViewer.show();
});
-
//file selector
ipcMain.on("get-file-path", (event, data) => {
dialog
@@ -676,7 +675,7 @@ ipcMain.on("save-file-to-folder", (event, data) => {
filepath.filePath,
arraybuffer,
"binary",
- function (err, data) {}
+ function (err, data) {},
);
} catch (err) {
console.log(err);
@@ -758,9 +757,9 @@ ipcMain.on(
(event, data) => {
win.webContents.send(
"action-show-arq-toast-datachannel-received-opener",
- data
+ data,
);
- }
+ },
);
// ARQ TRANSMISSION FAILED
@@ -789,9 +788,9 @@ ipcMain.on(
(event, data) => {
win.webContents.send(
"action-show-arq-toast-transmission-transmitting",
- data
+ data,
);
- }
+ },
);
// ARQ TRANSMISSION TRANSMITTED
diff --git a/gui/preload-chat.js b/gui/preload-chat.js
index bb0170a4..83b6c4c8 100644
--- a/gui/preload-chat.js
+++ b/gui/preload-chat.js
@@ -184,7 +184,7 @@ window.addEventListener("DOMContentLoaded", () => {
});
} else {
console.log(
- config.mycall + " not found in user db - creating new entry"
+ config.mycall + " not found in user db - creating new entry",
);
// add initial entry for own callsign and grid
let obj = new Object();
@@ -639,10 +639,10 @@ ipcRenderer.on("return-select-user-image", (event, arg) => {
.then(function (compressedFile) {
console.log(
"compressedFile instanceof Blob",
- compressedFile instanceof Blob
+ compressedFile instanceof Blob,
); // true
console.log(
- `compressedFile size ${compressedFile.size / 1024 / 1024} MB`
+ `compressedFile size ${compressedFile.size / 1024 / 1024} MB`,
); // smaller than maxSizeMB
console.log(compressedFile.size);
@@ -683,7 +683,7 @@ ipcRenderer.on("action-update-transmission-status", (event, arg) => {
document.getElementById("txtConnectedWithChat").textContent = data.dxcallsign;
-if (typeof data.uuid === undefined) return;
+ if (typeof data.uuid === undefined) return;
//console.log(data.status);
if (data.uuid !== "no-uuid") {
@@ -1056,16 +1056,19 @@ update_chat = function (obj) {
}
// check if wrong status message
- if (obj.status == "transmit" && obj.type == "transmit" && obj.percent < 100) {
+ if (obj.status == "transmit" && obj.type == "transmit" && obj.percent < 100) {
var TimeDifference = new Date().getTime() / 1000 - obj.timestamp;
- if (TimeDifference > 21600) { //Six hours
- console.log("Resetting message to failed state since in transmit status for over 6 hours:")
+ if (TimeDifference > 21600) {
+ //Six hours
+ console.log(
+ "Resetting message to failed state since in transmit status for over 6 hours:",
+ );
console.log(obj);
- db.upsert(obj._id, function (doc) {
- doc.status = "failed";
- return doc;
- });
- obj.status = "failed";
+ db.upsert(obj._id, function (doc) {
+ doc.status = "failed";
+ return doc;
+ });
+ obj.status = "failed";
}
}
if (typeof obj.new == "undefined") {
@@ -1114,7 +1117,7 @@ update_chat = function (obj) {
var fileheader = `
${percent_value} - ${obj.bytesperminute} Bpm
+ obj._id
+ }-progress-information">${percent_value} - ${
+ obj.bytesperminute
+ } Bpm
@@ -1527,7 +1532,7 @@ update_chat = function (obj) {
.getElementById("msg-" + obj._id + "-progress")
.setAttribute("style", "width:" + obj.percent + "%;");
document.getElementById(
- "msg-" + obj._id + "-progress-information"
+ "msg-" + obj._id + "-progress-information",
).innerHTML = obj.percent + "% - " + obj.bytesperminute + " Bpm";
document.getElementById("msg-" + obj._id + "-attempts").innerHTML =
@@ -1546,7 +1551,7 @@ update_chat = function (obj) {
.getElementById("msg-" + obj._id + "-progress")
.setAttribute("style", "width:" + obj.percent + "%;");
document.getElementById(
- "msg-" + obj._id + "-progress-information"
+ "msg-" + obj._id + "-progress-information",
).innerHTML = obj.percent + "% - " + obj.bytesperminute + " Bpm";
} else {
document
@@ -1556,7 +1561,7 @@ update_chat = function (obj) {
.getElementById("msg-" + obj._id + "-progress")
.setAttribute("style", "width:0%;");
document.getElementById(
- "msg-" + obj._id + "-progress-information"
+ "msg-" + obj._id + "-progress-information",
).innerHTML = "0% - 0 Bpm";
}
@@ -1578,7 +1583,7 @@ update_chat = function (obj) {
document.getElementById("msg-" + obj._id + "-progress").innerHTML = "";
document.getElementById(
- "msg-" + obj._id + "-progress-information"
+ "msg-" + obj._id + "-progress-information",
).innerHTML = "TRANSMITTED - " + obj.bytesperminute + " Bpm";
} else if (
obj.status != "broadcast_transmit" ||
@@ -1605,11 +1610,11 @@ update_chat = function (obj) {
.classList.add("bg-danger");
console.log(
- document.getElementById("msg-" + obj._id + "-progress").classList
+ document.getElementById("msg-" + obj._id + "-progress").classList,
);
document.getElementById(
- "msg-" + obj._id + "-progress-information"
+ "msg-" + obj._id + "-progress-information",
).innerHTML = "TRANSMISSION FAILED - " + obj.bytesperminute + " Bpm";
}
@@ -2461,7 +2466,7 @@ function getSetUserInformation(selected_callsign) {
// Callsign list elements
document.getElementById(
- "chat-" + selected_callsign + "-list-dxgrid"
+ "chat-" + selected_callsign + "-list-dxgrid",
).innerHTML = "" + data.user_info_gridsquare + "";
document.getElementById("user-image-" + selected_callsign).className =
"p-1 rounded-circle";
@@ -2524,7 +2529,7 @@ function getSetUserInformation(selected_callsign) {
document.getElementById("user-image-" + selected_callsign).style =
"height:60px";
document.getElementById(
- "chat-" + selected_callsign + "-list-dxgrid"
+ "chat-" + selected_callsign + "-list-dxgrid",
).innerHTML = "no grid";
// DX Station tab
@@ -2862,13 +2867,13 @@ async function dbClean() {
let beaconKeep = 7;
let itemCount = 0;
let timestampPurge = Math.floor(
- (Date.now() - beaconKeep * 24 * 60 * 60 * 1000) / 1000
+ (Date.now() - beaconKeep * 24 * 60 * 60 * 1000) / 1000,
);
if (
confirm(
"Delete beacons and pings older than " +
beaconKeep +
- " days and compact database?"
+ " days and compact database?",
)
) {
} else {
@@ -2911,7 +2916,7 @@ async function dbClean() {
window.alert(
"Database maintenance is complete. " +
itemCount +
- " items removed from database. It's recommended you now restart the GUI."
+ " items removed from database. It's recommended you now restart the GUI.",
);
ipcRenderer.send("request-update-dbclean-spinner");
}
diff --git a/gui/preload-log.js b/gui/preload-log.js
index c03ed70a..9e2bcbc2 100644
--- a/gui/preload-log.js
+++ b/gui/preload-log.js
@@ -73,7 +73,7 @@ ipcRenderer.on("action-update-log", (event, arg) => {
// https://stackoverflow.com/a/29497680
entry = entry.replace(
/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g,
- ""
+ "",
);
var tbl = document.getElementById("log");
diff --git a/gui/preload-main.js b/gui/preload-main.js
index bcf99f48..7201775c 100644
--- a/gui/preload-main.js
+++ b/gui/preload-main.js
@@ -201,7 +201,7 @@ window.addEventListener("DOMContentLoaded", () => {
FD.saveConfig(config, configPath);
//fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
- }
+ },
);
});
@@ -221,7 +221,7 @@ window.addEventListener("DOMContentLoaded", () => {
config.shared_folder_path = data.path.filePaths[0];
//fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
FD.saveConfig(config, configPath);
- }
+ },
);
});
@@ -245,7 +245,7 @@ window.addEventListener("DOMContentLoaded", () => {
// ENABLE TOOLTIPS EVERYWHERE
// https://getbootstrap.com/docs/5.1/components/tooltips/
var tooltipTriggerList = [].slice.call(
- document.querySelectorAll('[data-bs-toggle="tooltip"]')
+ document.querySelectorAll('[data-bs-toggle="tooltip"]'),
);
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl);
@@ -397,21 +397,16 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("NotificationSwitch").checked = false;
}
- if(config.enable_mesh_features.toLowerCase() == "true"){
- document.getElementById("liMeshTable").style.visibility = "visible";
+ if (config.enable_mesh_features.toLowerCase() == "true") {
+ document.getElementById("liMeshTable").style.visibility = "visible";
document.getElementById("liMeshTable").style.display = "block";
document.getElementById("enableMeshSwitch").checked = true;
-
-
} else {
- document.getElementById("liMeshTable").style.visibility = "hidden";
+ document.getElementById("liMeshTable").style.visibility = "hidden";
document.getElementById("liMeshTable").style.display = "none";
- document.getElementById("enableMeshSwitch").checked = false;
-
+ document.getElementById("enableMeshSwitch").checked = false;
}
-
-
// theme selector
changeGuiDesign(config.theme);
@@ -419,7 +414,7 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("update_channel_selector").value =
config.update_channel;
document.getElementById("updater_channel").innerHTML = escape(
- config.update_channel
+ config.update_channel,
);
// Update tuning range fmin fmax
@@ -431,10 +426,10 @@ window.addEventListener("DOMContentLoaded", () => {
// Update TX Audio Level
document.getElementById("audioLevelTXvalue").innerHTML = parseInt(
- config.tx_audio_level
+ config.tx_audio_level,
);
document.getElementById("audioLevelTX").value = parseInt(
- config.tx_audio_level
+ config.tx_audio_level,
);
// Update RX Buffer Size
@@ -734,7 +729,7 @@ window.addEventListener("DOMContentLoaded", () => {
.getElementById("hamlib_rigctld_server_port")
.addEventListener("change", () => {
config.hamlib_rigctld_server_port = document.getElementById(
- "hamlib_rigctld_server_port"
+ "hamlib_rigctld_server_port",
).value;
//fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
FD.saveConfig(config, configPath);
@@ -809,7 +804,7 @@ window.addEventListener("DOMContentLoaded", () => {
if (document.getElementById("hamlib_handshake").value !== "ignore") {
var hamlib_handshake = document.getElementById("hamlib_handshake").value;
paramList = paramList.concat(
- "--set-conf=serial_handshake=" + hamlib_handshake
+ "--set-conf=serial_handshake=" + hamlib_handshake,
);
}
@@ -838,13 +833,13 @@ window.addEventListener("DOMContentLoaded", () => {
}
var hamlib_rigctld_server_port = document.getElementById(
- "hamlib_rigctld_server_port"
+ "hamlib_rigctld_server_port",
).value;
paramList = paramList.concat("--port=" + hamlib_rigctld_server_port);
//Custom rigctld arguments to pass to rigctld
var hamlib_rigctld_custom_args = document.getElementById(
- "hamlib_rigctld_custom_args"
+ "hamlib_rigctld_custom_args",
).value;
paramList = paramList.concat(hamlib_rigctld_custom_args);
@@ -1006,7 +1001,7 @@ window.addEventListener("DOMContentLoaded", () => {
// on change audio TX Level
document.getElementById("audioLevelTX").addEventListener("change", () => {
var tx_audio_level = parseInt(
- document.getElementById("audioLevelTX").value
+ document.getElementById("audioLevelTX").value,
);
document.getElementById("audioLevelTXvalue").innerHTML = tx_audio_level;
config.tx_audio_level = tx_audio_level;
@@ -1263,18 +1258,17 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("enableMeshSwitch").addEventListener("click", () => {
if (document.getElementById("enableMeshSwitch").checked == true) {
config.enable_mesh_features = "True";
- document.getElementById("liMeshTable").style.visibility = "visible";
- document.getElementById("liMeshTable").style.display = "block";
+ document.getElementById("liMeshTable").style.visibility = "visible";
+ document.getElementById("liMeshTable").style.display = "block";
} else {
config.enable_mesh_features = "False";
- document.getElementById("liMeshTable").style.visibility = "hidden";
- document.getElementById("liMeshTable").style.display = "none";
+ document.getElementById("liMeshTable").style.visibility = "hidden";
+ document.getElementById("liMeshTable").style.display = "none";
}
//fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
FD.saveConfig(config, configPath);
});
-
// enable is writing switch clicked
document.getElementById("enable_is_writing").addEventListener("click", () => {
if (document.getElementById("enable_is_writing").checked == true) {
@@ -1372,7 +1366,7 @@ window.addEventListener("DOMContentLoaded", () => {
.getElementById("update_channel_selector")
.addEventListener("change", () => {
config.update_channel = document.getElementById(
- "update_channel_selector"
+ "update_channel_selector",
).value;
//fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
FD.saveConfig(config, configPath);
@@ -1399,7 +1393,7 @@ window.addEventListener("DOMContentLoaded", () => {
document.getElementById("openExplorer").addEventListener("click", () => {
shell.openExternal(
"https://explorer.freedata.app/?myCall=" +
- document.getElementById("myCall").value
+ document.getElementById("myCall").value,
);
});
@@ -1438,7 +1432,7 @@ window.addEventListener("DOMContentLoaded", () => {
var tci_port = document.getElementById("tci_port").value;
var hamlib_rigctld_server_port = document.getElementById(
- "hamlib_rigctld_server_port"
+ "hamlib_rigctld_server_port",
).value;
var deviceid = document.getElementById("hamlib_deviceid").value;
@@ -1462,15 +1456,15 @@ window.addEventListener("DOMContentLoaded", () => {
var handshake = document.getElementById("hamlib_handshake").value;
var tx_delay = document.getElementById("tx_delay").value;
- if (document.getElementById("enableMeshSwitch").checked == true) {
- var enable_mesh_features = "True";
- document.getElementById("liMeshTable").style.visibility = "visible";
- document.getElementById("liMeshTable").style.display = "block";
- } else {
- var enable_mesh_features = "False";
- document.getElementById("liMeshTable").style.visibility = "hidden";
- document.getElementById("liMeshTable").style.display = "none";
- }
+ if (document.getElementById("enableMeshSwitch").checked == true) {
+ var enable_mesh_features = "True";
+ document.getElementById("liMeshTable").style.visibility = "visible";
+ document.getElementById("liMeshTable").style.display = "block";
+ } else {
+ var enable_mesh_features = "False";
+ document.getElementById("liMeshTable").style.visibility = "hidden";
+ document.getElementById("liMeshTable").style.display = "none";
+ }
if (document.getElementById("scatterSwitch").checked == true) {
var enable_scatter = "True";
@@ -1598,7 +1592,7 @@ window.addEventListener("DOMContentLoaded", () => {
) {
if (
!window.confirm(
- "Rig control is set to hamlib/rigctl, but it doesn't appear to be running.\n\nPlease start rigctld (start button in Rig Control area), or use rigctl mode 'none'. If you're having issues starting rigctld please review the Hamlib tab in settings.\n\nClick OK to continue or cancel to abort."
+ "Rig control is set to hamlib/rigctl, but it doesn't appear to be running.\n\nPlease start rigctld (start button in Rig Control area), or use rigctl mode 'none'. If you're having issues starting rigctld please review the Hamlib tab in settings.\n\nClick OK to continue or cancel to abort.",
)
) {
return;
@@ -1636,7 +1630,7 @@ window.addEventListener("DOMContentLoaded", () => {
tx_delay,
tci_ip,
tci_port,
- enable_mesh_features
+ enable_mesh_features,
);
});
@@ -1693,7 +1687,7 @@ window.addEventListener("DOMContentLoaded", () => {
stop_bits,
handshake,
rigctld_ip,
- rigctld_port
+ rigctld_port,
);
});
@@ -1803,20 +1797,14 @@ window.addEventListener("DOMContentLoaded", () => {
resetSortIcon();
});
-
-
-
- autostart_rigctld();
-
-
-
+ autostart_rigctld();
});
//End of domcontentloaded
function resetSortIcon() {
document.getElementById("hslSort").remove();
let headers = document.querySelectorAll(
- "#tblHeardStationList > thead > tr > th"
+ "#tblHeardStationList > thead > tr > th",
);
if (hslLastSortDir == "desc") text = "bi-sort-up";
else text = "bi-sort-down";
@@ -1857,8 +1845,8 @@ function connectedStation(data) {
}
//Called by chat to turn off db clean spinner
-ipcRenderer.on("action-update-dbclean-spinner",() =>{
- document.getElementById("divCleanDBSpinner").classList.add("invisible");
+ipcRenderer.on("action-update-dbclean-spinner", () => {
+ document.getElementById("divCleanDBSpinner").classList.add("invisible");
});
//Listen for events caused by tnc 'tnc-message' rx
ipcRenderer.on("action-update-reception-status", (event, arg) => {
@@ -1917,7 +1905,7 @@ ipcRenderer.on("action-update-reception-status", (event, arg) => {
compress = 1;
}
var arq_bytes_per_minute_compressed = Math.round(
- arq_bytes_per_minute * compress
+ arq_bytes_per_minute * compress,
);
console.log(arq_bytes_per_minute);
time_left +=
@@ -1986,7 +1974,7 @@ ipcRenderer.on("action-update-transmission-status", (event, arg) => {
compress = 1;
}
var arq_bytes_per_minute_compressed = Math.round(
- arq_bytes_per_minute * compress
+ arq_bytes_per_minute * compress,
);
time_left +=
@@ -2507,7 +2495,7 @@ function updateHeardStations(arg) {
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
- }
+ },
);
//var hours = date.getHours();
//var minutes = "0" + date.getMinutes();
@@ -2548,8 +2536,8 @@ function updateHeardStations(arg) {
parseInt(
distance(
document.getElementById("myGrid").value,
- arg.stations[i]["dxgrid"]
- )
+ arg.stations[i]["dxgrid"],
+ ),
) + " km";
} else {
gridDistanceText.innerText = "---";
@@ -2807,22 +2795,22 @@ ipcRenderer.on("action-update-tnc-connection", (event, arg) => {
// collapse settings screen
var collapseFirstRow = new bootstrap.Collapse(
document.getElementById("collapseFirstRow"),
- { toggle: false }
+ { toggle: false },
);
collapseFirstRow.hide();
var collapseSecondRow = new bootstrap.Collapse(
document.getElementById("collapseSecondRow"),
- { toggle: false }
+ { toggle: false },
);
collapseSecondRow.hide();
var collapseThirdRow = new bootstrap.Collapse(
document.getElementById("collapseThirdRow"),
- { toggle: false }
+ { toggle: false },
);
collapseThirdRow.show();
var collapseFourthRow = new bootstrap.Collapse(
document.getElementById("collapseFourthRow"),
- { toggle: false }
+ { toggle: false },
);
collapseFourthRow.show();
@@ -2848,22 +2836,22 @@ ipcRenderer.on("action-update-tnc-connection", (event, arg) => {
// collapse settings screen
var collapseFirstRow = new bootstrap.Collapse(
document.getElementById("collapseFirstRow"),
- { toggle: false }
+ { toggle: false },
);
collapseFirstRow.show();
var collapseSecondRow = new bootstrap.Collapse(
document.getElementById("collapseSecondRow"),
- { toggle: false }
+ { toggle: false },
);
collapseSecondRow.show();
var collapseThirdRow = new bootstrap.Collapse(
document.getElementById("collapseThirdRow"),
- { toggle: false }
+ { toggle: false },
);
collapseThirdRow.hide();
var collapseFourthRow = new bootstrap.Collapse(
document.getElementById("collapseFourthRow"),
- { toggle: false }
+ { toggle: false },
);
collapseFourthRow.hide();
}
@@ -2960,7 +2948,7 @@ ipcRenderer.on("action-update-rx-buffer", (event, arg) => {
},
function (err) {
console.log(err);
- }
+ },
);
// write file to data folder
@@ -2997,7 +2985,6 @@ ipcRenderer.on("action-update-unread-messages-main", (event, data) => {
});
ipcRenderer.on("run-tnc-command", (event, arg) => {
-
if (arg.command == "save_my_call") {
sock.saveMyCall(arg.callsign);
}
@@ -3016,7 +3003,7 @@ ipcRenderer.on("run-tnc-command", (event, arg) => {
arg.filename,
arg.filetype,
arg.data,
- arg.checksum
+ arg.checksum,
);
}
if (arg.command == "msg") {
@@ -3027,7 +3014,7 @@ ipcRenderer.on("run-tnc-command", (event, arg) => {
arg.data,
arg.checksum,
arg.uuid,
- arg.command
+ arg.command,
);
}
if (arg.command == "broadcast") {
@@ -3078,11 +3065,9 @@ ipcRenderer.on("run-tnc-command", (event, arg) => {
sock.sendResponseSharedFile(arg.dxcallsign, arg.file, arg.filedata);
}
- if (arg.command == "mesh_ping") {
+ if (arg.command == "mesh_ping") {
sock.sendMeshPing(arg.dxcallsign);
}
-
-
});
// IPC ACTION FOR AUTO UPDATER
@@ -3113,7 +3098,7 @@ ipcRenderer.on("action-updater", (event, arg) => {
config.myCall,
config.tnc_host,
config.tnc_port,
- " -v " + arg.version
+ " -v " + arg.version,
);
document.getElementById("updater_status").innerHTML =
'';
@@ -3165,7 +3150,7 @@ ipcRenderer.on("action-show-cq-toast-transmitting", (event, data) => {
(type = "success"),
(icon = "bi-broadcast"),
(content = "transmitting cq"),
- (duration = 5000)
+ (duration = 5000),
);
});
// fec iswriting received
@@ -3176,7 +3161,7 @@ ipcRenderer.on("action-show-fec-toast-iswriting", (event, data) => {
(type = "success"),
(icon = "bi-pencil-fill"),
(content = content),
- (duration = 5000)
+ (duration = 5000),
);
});
// CQ RECEIVED
@@ -3189,7 +3174,7 @@ ipcRenderer.on("action-show-cq-toast-received", (event, data) => {
(type = "success"),
(icon = "bi-broadcast"),
(content = content),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3199,7 +3184,7 @@ ipcRenderer.on("action-show-qrv-toast-transmitting", (event, data) => {
(type = "success"),
(icon = "bi-broadcast"),
(content = "transmitting qrv"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3214,7 +3199,7 @@ ipcRenderer.on("action-show-qrv-toast-received", (event, data) => {
(type = "success"),
(icon = "bi-broadcast"),
(content = content),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3224,7 +3209,7 @@ ipcRenderer.on("action-show-beacon-toast-transmitting", (event, data) => {
(type = "info"),
(icon = "bi-broadcast"),
(content = "transmitting beacon"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3238,7 +3223,7 @@ ipcRenderer.on("action-show-beacon-toast-received", (event, data) => {
(type = "info"),
(icon = "bi-broadcast"),
(content = content),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3248,7 +3233,7 @@ ipcRenderer.on("action-show-ping-toast-transmitting", (event, data) => {
(type = "success"),
(icon = "bi-broadcast"),
(content = "transmitting ping"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3261,7 +3246,7 @@ ipcRenderer.on("action-show-ping-toast-received", (event, data) => {
(type = "success"),
(icon = "bi-broadcast"),
(content = content),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3275,7 +3260,7 @@ ipcRenderer.on("action-show-ping-toast-received-ack", (event, data) => {
(type = "success"),
(icon = "bi-check"),
(content = content),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3288,7 +3273,7 @@ ipcRenderer.on("action-show-arq-toast-datachannel-opening", (event, data) => {
(type = "secondary"),
(icon = "bi-arrow-left-right"),
(content = content),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3298,7 +3283,7 @@ ipcRenderer.on("action-show-arq-toast-datachannel-waiting", (event, data) => {
(type = "warning"),
(icon = "bi-smartwatch"),
(content = "channel busy - waiting..."),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3308,7 +3293,7 @@ ipcRenderer.on("action-show-arq-toast-datachannel-open", (event, data) => {
(type = "success"),
(icon = "bi-arrow-left-right"),
(content = "datachannel open"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3323,9 +3308,9 @@ ipcRenderer.on(
(type = "success"),
(icon = "bi-arrow-left-right"),
(content = content),
- (duration = 5000)
+ (duration = 5000),
);
- }
+ },
);
// ARQ TRANSMISSION FAILED
@@ -3335,7 +3320,7 @@ ipcRenderer.on("action-show-arq-toast-transmission-failed", (event, data) => {
(type = "danger"),
(icon = "bi-arrow-left-right"),
(content = "transmission failed"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3347,9 +3332,9 @@ ipcRenderer.on(
(type = "danger"),
(icon = "bi-broadcast"),
(content = "protocol version missmatch"),
- (duration = 5000)
+ (duration = 5000),
);
- }
+ },
);
// ARQ TRANSMISSION STOPPED
@@ -3359,7 +3344,7 @@ ipcRenderer.on("action-show-arq-toast-transmission-stopped", (event, data) => {
(type = "success"),
(icon = "bi-arrow-left-right"),
(content = "transmission stopped"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3370,7 +3355,7 @@ ipcRenderer.on("action-show-arq-toast-transmission-failed", (event, data) => {
(type = "danger"),
(icon = "bi-broadcast"),
(content = "arq transmission failed"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3384,9 +3369,9 @@ ipcRenderer.on(
(type = "success"),
(icon = "bi-broadcast"),
(content = "data transmitted"),
- (duration = 5000)
+ (duration = 5000),
);
- }
+ },
);
// ARQ TRANSMISSION TRANSMITTING
@@ -3400,21 +3385,21 @@ ipcRenderer.on(
(type = "warning"),
(icon = "bi-broadcast"),
(content = "low link margin: " + irs_snr + " dB"),
- (duration = 5000)
+ (duration = 5000),
);
} else if (irs_snr > 0 && irs_snr <= 5) {
displayToast(
(type = "warning"),
(icon = "bi-broadcast"),
(content = "medium link margin: " + irs_snr + " dB"),
- (duration = 5000)
+ (duration = 5000),
);
} else if (irs_snr > 5 && irs_snr < 12.7) {
displayToast(
(type = "success"),
(icon = "bi-broadcast"),
(content = "high link margin: " + irs_snr + " dB"),
- (duration = 5000)
+ (duration = 5000),
);
} else if (irs_snr >= 12.7) {
displayToast(
@@ -3422,12 +3407,12 @@ ipcRenderer.on(
(icon = "bi-broadcast"),
(content =
"very high link margin: " + irs_snr + " dB"),
- (duration = 5000)
+ (duration = 5000),
);
} else {
//displayToast(type='info', icon='bi-broadcast', content='no snr information', duration=5000);
}
- }
+ },
);
// ARQ TRANSMISSION RECEIVED
@@ -3437,7 +3422,7 @@ ipcRenderer.on("action-show-arq-toast-transmission-received", (event, data) => {
(type = "success"),
(icon = "bi-check-circle"),
(content = "all data received"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3449,9 +3434,9 @@ ipcRenderer.on(
(type = "primary"),
(icon = "bi-arrow-left-right"),
(content = "session receiving"),
- (duration = 5000)
+ (duration = 5000),
);
- }
+ },
);
// ARQ SESSION CONNECTING
@@ -3460,7 +3445,7 @@ ipcRenderer.on("action-show-arq-toast-session-connecting", (event, data) => {
(type = "primary"),
(icon = "bi-arrow-left-right"),
(content = "connecting..."),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3470,7 +3455,7 @@ ipcRenderer.on("action-show-arq-toast-session-connected", (event, data) => {
(type = "success"),
(icon = "bi-arrow-left-right"),
(content = "session connected"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3480,7 +3465,7 @@ ipcRenderer.on("action-show-arq-toast-session-waiting", (event, data) => {
(type = "warning"),
(icon = "bi-smartwatch"),
(content = "session waiting..."),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3490,7 +3475,7 @@ ipcRenderer.on("action-show-arq-toast-session-close", (event, data) => {
(type = "warning"),
(icon = "bi-arrow-left-right"),
(content = "session close"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3500,7 +3485,7 @@ ipcRenderer.on("action-show-arq-toast-session-failed", (event, data) => {
(type = "danger"),
(icon = "bi-arrow-left-right"),
(content = "session failed"),
- (duration = 5000)
+ (duration = 5000),
);
});
@@ -3565,7 +3550,7 @@ function updateTitle(
mycall = config.mycall,
tnc = config.tnc_host,
tncport = config.tnc_port,
- appender = ""
+ appender = "",
) {
//Multiple consecutive spaces get converted to a single space
var title =
@@ -3657,7 +3642,7 @@ function displayToast(
type = "primary",
icon = "bi-info",
content = "default",
- duration = 5000
+ duration = 5000,
) {
mainToastContainer = document.getElementById("mainToastContainer");
diff --git a/gui/preload-mesh.js b/gui/preload-mesh.js
index 2834a84e..4c3a90d2 100644
--- a/gui/preload-mesh.js
+++ b/gui/preload-mesh.js
@@ -13,176 +13,164 @@ const config = require(configPath);
// WINDOW LISTENER
window.addEventListener("DOMContentLoaded", () => {
-
// startPing button clicked
- document.getElementById("transmit_mesh_ping").addEventListener("click", () => {
- var dxcallsign = document.getElementById("dxCallMesh").value.toUpperCase();
- if (dxcallsign == "" || dxcallsign == null || dxcallsign == undefined)
- return;
- //pauseButton(document.getElementById("transmit_mesh_ping"), 2000);
- ipcRenderer.send("run-tnc-command", {
- command: "mesh_ping",
- dxcallsign: dxcallsign,
+ document
+ .getElementById("transmit_mesh_ping")
+ .addEventListener("click", () => {
+ var dxcallsign = document
+ .getElementById("dxCallMesh")
+ .value.toUpperCase();
+ if (dxcallsign == "" || dxcallsign == null || dxcallsign == undefined)
+ return;
+ //pauseButton(document.getElementById("transmit_mesh_ping"), 2000);
+ ipcRenderer.send("run-tnc-command", {
+ command: "mesh_ping",
+ dxcallsign: dxcallsign,
+ });
});
- });
-
-
-
});
-
ipcRenderer.on("action-update-mesh-table", (event, arg) => {
var routes = arg.routing_table;
-if (typeof routes == "undefined") {
+ if (typeof routes == "undefined") {
return;
}
-
- var tbl = document.getElementById("mesh-table");
-if (tbl !== null) {
- tbl.innerHTML = "";
-
+ var tbl = document.getElementById("mesh-table");
+ if (tbl !== null) {
+ tbl.innerHTML = "";
}
-
-for (i = 0; i < routes.length; i++) {
-
- var row = document.createElement("tr");
+ for (i = 0; i < routes.length; i++) {
+ var row = document.createElement("tr");
var datetime = new Date(routes[i]["timestamp"] * 1000).toLocaleString(
- navigator.language,{
- hourCycle: 'h23',
+ navigator.language,
+ {
+ hourCycle: "h23",
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
- second: "2-digit"
- }
+ second: "2-digit",
+ },
);
- var timestamp = document.createElement("td");
- var timestampText = document.createElement("span");
- timestampText.innerText = datetime;
- timestamp.appendChild(timestampText);
+ var timestamp = document.createElement("td");
+ var timestampText = document.createElement("span");
+ timestampText.innerText = datetime;
+ timestamp.appendChild(timestampText);
- var dxcall = document.createElement("td");
- var dxcallText = document.createElement("span");
- dxcallText.innerText = routes[i]["dxcall"];
- dxcall.appendChild(dxcallText);
+ var dxcall = document.createElement("td");
+ var dxcallText = document.createElement("span");
+ dxcallText.innerText = routes[i]["dxcall"];
+ dxcall.appendChild(dxcallText);
- var router = document.createElement("td");
- var routerText = document.createElement("span");
- routerText.innerText = routes[i]["router"];
- router.appendChild(routerText);
+ var router = document.createElement("td");
+ var routerText = document.createElement("span");
+ routerText.innerText = routes[i]["router"];
+ router.appendChild(routerText);
- var hops = document.createElement("td");
- var hopsText = document.createElement("span");
- hopsText.innerText = routes[i]["hops"];
- hops.appendChild(hopsText);
+ var hops = document.createElement("td");
+ var hopsText = document.createElement("span");
+ hopsText.innerText = routes[i]["hops"];
+ hops.appendChild(hopsText);
var score = document.createElement("td");
- var scoreText = document.createElement("span");
- scoreText.innerText = routes[i]["score"];
- score.appendChild(scoreText);
+ var scoreText = document.createElement("span");
+ scoreText.innerText = routes[i]["score"];
+ score.appendChild(scoreText);
var snr = document.createElement("td");
- var snrText = document.createElement("span");
- snrText.innerText = routes[i]["snr"];
- snr.appendChild(snrText);
+ var snrText = document.createElement("span");
+ snrText.innerText = routes[i]["snr"];
+ snr.appendChild(snrText);
- row.appendChild(timestamp);
- row.appendChild(dxcall);
- row.appendChild(router);
- row.appendChild(hops);
- row.appendChild(score);
- row.appendChild(snr);
+ row.appendChild(timestamp);
+ row.appendChild(dxcall);
+ row.appendChild(router);
+ row.appendChild(hops);
+ row.appendChild(score);
+ row.appendChild(snr);
-
-
- tbl.appendChild(row);
-}
+ tbl.appendChild(row);
+ }
/*-------------------------------------------*/
- var routes = arg.mesh_signalling_table;
+ var routes = arg.mesh_signalling_table;
-console.log(routes)
-if (typeof routes == "undefined") {
+ console.log(routes);
+ if (typeof routes == "undefined") {
return;
}
-
- var tbl = document.getElementById("mesh-signalling-table");
-if (tbl !== null) {
- tbl.innerHTML = "";
-
+ var tbl = document.getElementById("mesh-signalling-table");
+ if (tbl !== null) {
+ tbl.innerHTML = "";
}
-
-for (i = 0; i < routes.length; i++) {
-
- var row = document.createElement("tr");
+ for (i = 0; i < routes.length; i++) {
+ var row = document.createElement("tr");
var datetime = new Date(routes[i]["timestamp"] * 1000).toLocaleString(
- navigator.language,{
- hourCycle: 'h23',
+ navigator.language,
+ {
+ hourCycle: "h23",
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
- second: "2-digit"
- }
+ second: "2-digit",
+ },
);
- var timestamp = document.createElement("td");
- var timestampText = document.createElement("span");
- timestampText.innerText = datetime;
- timestamp.appendChild(timestampText);
+ var timestamp = document.createElement("td");
+ var timestampText = document.createElement("span");
+ timestampText.innerText = datetime;
+ timestamp.appendChild(timestampText);
- var destination = document.createElement("td");
- var destinationText = document.createElement("span");
- destinationText.innerText = routes[i]["destination"];
- destination.appendChild(destinationText);
+ var destination = document.createElement("td");
+ var destinationText = document.createElement("span");
+ destinationText.innerText = routes[i]["destination"];
+ destination.appendChild(destinationText);
- var router = document.createElement("td");
- var routerText = document.createElement("span");
- routerText.innerText = routes[i]["router"];
- router.appendChild(routerText);
+ var router = document.createElement("td");
+ var routerText = document.createElement("span");
+ routerText.innerText = routes[i]["router"];
+ router.appendChild(routerText);
- var frametype = document.createElement("td");
- var frametypeText = document.createElement("span");
- frametypeText.innerText = routes[i]["frametype"];
- frametype.appendChild(frametypeText);
+ var frametype = document.createElement("td");
+ var frametypeText = document.createElement("span");
+ frametypeText.innerText = routes[i]["frametype"];
+ frametype.appendChild(frametypeText);
var payload = document.createElement("td");
- var payloadText = document.createElement("span");
- payloadText.innerText = routes[i]["payload"];
- payload.appendChild(payloadText);
+ var payloadText = document.createElement("span");
+ payloadText.innerText = routes[i]["payload"];
+ payload.appendChild(payloadText);
var attempt = document.createElement("td");
- var attemptText = document.createElement("span");
- attemptText.innerText = routes[i]["attempt"];
- attempt.appendChild(attemptText);
+ var attemptText = document.createElement("span");
+ attemptText.innerText = routes[i]["attempt"];
+ attempt.appendChild(attemptText);
var status = document.createElement("td");
- var statusText = document.createElement("span");
- statusText.innerText = routes[i]["status"];
- status.appendChild(statusText);
+ var statusText = document.createElement("span");
+ statusText.innerText = routes[i]["status"];
+ status.appendChild(statusText);
+ row.appendChild(timestamp);
+ row.appendChild(destination);
+ row.appendChild(router);
+ row.appendChild(frametype);
+ row.appendChild(payload);
+ row.appendChild(attempt);
+ row.appendChild(status);
- row.appendChild(timestamp);
- row.appendChild(destination);
- row.appendChild(router);
- row.appendChild(frametype);
- row.appendChild(payload);
- row.appendChild(attempt);
- row.appendChild(status);
+ tbl.appendChild(row);
+ }
- tbl.appendChild(row);
-}
-
-
-if (tbl !== null) {
-
- // scroll to bottom of page
- // https://stackoverflow.com/a/11715670
- //window.scrollTo(0, document.body.scrollHeight);
+ if (tbl !== null) {
+ // scroll to bottom of page
+ // https://stackoverflow.com/a/11715670
+ //window.scrollTo(0, document.body.scrollHeight);
}
});
diff --git a/gui/sock.js b/gui/sock.js
index 3db27039..50fbb724 100644
--- a/gui/sock.js
+++ b/gui/sock.js
@@ -397,7 +397,7 @@ client.on("data", function (socketdata) {
} else {
ipcRenderer.send(
"request-show-arq-toast-datachannel-received-opener",
- { data: [data] }
+ { data: [data] },
);
ipcRenderer.send("request-update-reception-status", {
data: [data],
@@ -425,7 +425,7 @@ client.on("data", function (socketdata) {
if (data["reason"] == "protocol version missmatch") {
ipcRenderer.send(
"request-show-arq-toast-transmission-failed-ver",
- { data: [data] }
+ { data: [data] },
);
} else {
ipcRenderer.send("request-show-arq-toast-transmission-failed", {
@@ -492,7 +492,7 @@ client.on("data", function (socketdata) {
// ARQ transmitting
ipcRenderer.send(
"request-show-arq-toast-transmission-transmitting",
- { data: [data] }
+ { data: [data] },
);
ipcRenderer.send("request-update-transmission-status", {
data: [data],
@@ -503,7 +503,7 @@ client.on("data", function (socketdata) {
// ARQ transmitted
ipcRenderer.send(
"request-show-arq-toast-transmission-transmitted",
- { data: [data] }
+ { data: [data] },
);
ipcRenderer.send("request-update-transmission-status", {
data: [data],
@@ -618,7 +618,7 @@ exports.sendFile = function (
filename,
filetype,
data,
- checksum
+ checksum,
) {
socketLog.info(data);
socketLog.info(filetype);
@@ -664,7 +664,7 @@ exports.sendMessage = function (
data,
checksum,
uuid,
- command
+ command,
) {
data = FD.btoa_FD(
"m" +
@@ -675,7 +675,7 @@ exports.sendMessage = function (
split_char +
uuid +
split_char +
- data
+ data,
);
command =
'{"type" : "arq", "command" : "send_raw", "uuid" : "' +
@@ -776,13 +776,13 @@ exports.sendResponseSharedFolderList = function (dxcallsign, sharedFolderList) {
exports.sendResponseSharedFile = function (
dxcallsign,
sharedFile,
- sharedFileData
+ sharedFileData,
) {
console.log(
"In sendResponseSharedFile",
dxcallsign,
sharedFile,
- sharedFileData
+ sharedFileData,
);
//Command 0 = user/station information
//Command 1 = shared folder list
@@ -862,8 +862,6 @@ exports.sendFecIsWriting = function (mycallsign) {
writeTncCommand(command);
};
-
-
// SEND FEC TO BROADCASTCHANNEL
exports.sendBroadcastChannel = function (channel, data_out, uuid) {
let checksum = "";
@@ -877,7 +875,7 @@ exports.sendBroadcastChannel = function (channel, data_out, uuid) {
split_char +
uuid +
split_char +
- data_out
+ data_out,
);
console.log(data.length);
let payload = data;
diff --git a/gui/src/chat-module.html b/gui/src/chat-module.html
index 54eee4d6..7f161b2b 100644
--- a/gui/src/chat-module.html
+++ b/gui/src/chat-module.html
@@ -1,4 +1,4 @@
-
+
diff --git a/gui/src/data-module.html b/gui/src/data-module.html
index ce3b3cc8..30e6605d 100644
--- a/gui/src/data-module.html
+++ b/gui/src/data-module.html
@@ -1,4 +1,4 @@
-
+
diff --git a/gui/src/index.html b/gui/src/index.html
index 52dee847..20eae1d1 100644
--- a/gui/src/index.html
+++ b/gui/src/index.html
@@ -1,4 +1,4 @@
-
+
@@ -216,17 +216,17 @@
-
-
-
-
-
+
+
+
+
+