mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Prettified Code!
This commit is contained in:
parent
41554904e5
commit
62620f4f9c
|
@ -1062,7 +1062,9 @@ function downloadJsonUrlToFile(url, callsignPath) {
|
|||
//console.log(d);
|
||||
let json = JSON.parse(d);
|
||||
fs.writeFileSync(callsignPath, JSON.stringify(json, null, 2));
|
||||
sysInfo.info("Download " + url +" return statuscode: " + res.statusCode);
|
||||
sysInfo.info(
|
||||
"Download " + url + " return statuscode: " + res.statusCode,
|
||||
);
|
||||
});
|
||||
})
|
||||
.on("error", (e) => {
|
||||
|
|
|
@ -145,8 +145,6 @@ var chatFilter = [
|
|||
//{ type: "response" },
|
||||
];
|
||||
|
||||
|
||||
|
||||
// WINDOW LISTENER
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
updateAllChat(false);
|
||||
|
@ -219,7 +217,12 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
chatFilter.length = 0;
|
||||
if (document.getElementById("chkMessage").checked == true) {
|
||||
chatFilter = [{ type: "newchat" }];
|
||||
chatFilter.push({ type: "received" }, { type: "transmit" }, { type: "broadcast_received" },{ type: "broadcast_transmit" });
|
||||
chatFilter.push(
|
||||
{ type: "received" },
|
||||
{ type: "transmit" },
|
||||
{ type: "broadcast_received" },
|
||||
{ type: "broadcast_transmit" },
|
||||
);
|
||||
}
|
||||
if (document.getElementById("chkPing").checked == true)
|
||||
chatFilter.push({ type: "ping" });
|
||||
|
@ -1073,7 +1076,11 @@ update_chat = function (obj) {
|
|||
}
|
||||
}
|
||||
// check if in transmitting status and @ 100%
|
||||
if (obj.status == "transmitting" && obj.type == "transmit" && obj.percent == 100) {
|
||||
if (
|
||||
obj.status == "transmitting" &&
|
||||
obj.type == "transmit" &&
|
||||
obj.percent == 100
|
||||
) {
|
||||
var TimeDifference = new Date().getTime() / 1000 - obj.timestamp;
|
||||
if (TimeDifference > 21600) {
|
||||
//Six hours
|
||||
|
@ -1087,7 +1094,7 @@ update_chat = function (obj) {
|
|||
});
|
||||
obj.status = "transmitted";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof obj.new == "undefined") {
|
||||
obj.new = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue