From dc8c740cd47b90feb9a46443f505fba897ad3335 Mon Sep 17 00:00:00 2001 From: Kim Huebel Date: Mon, 8 Feb 2021 20:53:39 +0000 Subject: [PATCH] Bugfixing --- html/index.html | 6 ++-- html/js/config.js | 2 +- html/js/functions.js | 68 +++++++++++++++++++++++++++++++++++--------- html/js/version.js | 2 +- 4 files changed, 60 insertions(+), 18 deletions(-) diff --git a/html/index.html b/html/index.html index a97a0be..d5a7019 100644 --- a/html/index.html +++ b/html/index.html @@ -94,7 +94,7 @@
-
Last Heard List of today's callsigns.
+
Last Heard List
@@ -122,7 +122,7 @@
-
Local Heard List of today
+
Local Heard List
@@ -149,7 +149,7 @@
-
ALl Heard List
+
All Heard List
diff --git a/html/js/config.js b/html/js/config.js index c9671f4..42eeb3f 100644 --- a/html/js/config.js +++ b/html/js/config.js @@ -2,7 +2,7 @@ var qrz = 1; // 1 = enable debug in javascript-console, 0 = 0ff -var debug = 1; +var debug = 0; // Set messagecounters for different badge-colors var warnlevel = 200; diff --git a/html/js/functions.js b/html/js/functions.js index e0b8938..533dc95 100644 --- a/html/js/functions.js +++ b/html/js/functions.js @@ -59,6 +59,8 @@ function inDashboardBlacklist(logline) { name = ""; if (callsign.indexOf("$") > 0) { name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$")); + if (name == "$") + name = ""; callsign = callsign.substring(0, callsign.indexOf("$")); } return dashboard_blacklist.includes(callsign); @@ -119,9 +121,9 @@ function getCallsign(logline) { function getRawTarget(logline) { if(logline.indexOf(" at ") > 0 && logline.indexOf("late entry") < 0 ) { - return logline.substring(logline.indexOf("to") + 3, logline.lastIndexOf(" at ") + 1); + return logline.substring(logline.indexOf(" to ") + 4, logline.lastIndexOf(" at ") + 1); } else { - val = logline.substring(logline.indexOf("to") + 3); + val = logline.substring(logline.indexOf(" to ") + 4); if (val.indexOf(",") > 0) { val = val.substring(0, val.indexOf(",")); } @@ -141,6 +143,8 @@ function getTarget(logline) { name = ""; if (target.indexOf("$") > 0) { name = target.substring(target.indexOf("$") + 1, target.lastIndexOf("$")); + if (name == "$") + name = ""; target = target.substring(0, target.indexOf("$")); } if (qrz == 1 && isNaN(target) && !qrz_blacklist.includes(target)) { @@ -231,7 +235,18 @@ function getBER(logline) { function getAddToQSO(logline) { callsign = logline.substring(logline.indexOf("from") + 5, logline.indexOf("to")).trim(); - retval = '
'; + name = ""; + if (callsign.indexOf("$") > 0) { + name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$")); + if (name == "$") + name = ""; + callsign = callsign.substring(0, callsign.indexOf("$")); + } + if (name == "" ) { + retval = '
'; + } else { + retval = '
'; + } return retval; } @@ -318,6 +333,8 @@ function getCallsign(logline) { name = ""; if (callsign.indexOf("$") > 0) { name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$")); + if (name == "$") + name = ""; callsign = callsign.substring(0, callsign.indexOf("$")); } if (qrz == 1 && isNaN(callsign) && !qrz_blacklist.includes(callsign)) { @@ -339,20 +356,48 @@ function getCurrentTXing() { ts1 = null; ts2 = null; if (ts1TXing != null) { + matchstring = ""; ts1 = ts1TXing.split(";"); ts1[4] = Math.round((Date.now() - Date.parse(ts1timestamp.replace(" ","T")+".000Z"))/1000); t_qso.rows( function ( idx, data, node ) { - if(data[0] == ts1[1]){ + callsign = ts1[1]; + name = ""; + if (callsign.indexOf("$") > 0) { + name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$")); + if (name == "$") + name = ""; + callsign = callsign.substring(0, callsign.indexOf("$")); + } + if (name == "" ) { + matchstring = callsign; + } else { + matchstring = callsign + ' - ' + name; + } + if(data[0] == matchstring){ data[2] = getLocaltimeFromTimestamp(ts1timestamp); $('#inQSO').dataTable().fnUpdate(data,idx,undefined,false); } }).draw(false); } if (ts2TXing != null) { + matchstring = ""; ts2 = ts2TXing.split(";"); ts2[4] = Math.round((Date.now() - Date.parse(ts2timestamp.replace(" ","T")+".000Z"))/1000); t_qso.rows( function ( idx, data, node ) { - if(data[0] == ts2[1]){ + callsign = ts2[1]; + name = ""; + if (callsign.indexOf("$") > 0) { + name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$")); + if (name == "$") + name = ""; + callsign = callsign.substring(0, callsign.indexOf("$")); + } + if (name == "" ) { + matchstring = callsign; + } else { + matchstring = callsign + ' - ' + name; + } + if(data[0] == matchstring){ data[2] = getLocaltimeFromTimestamp(ts2timestamp); $('#inQSO').dataTable().fnUpdate(data,idx,undefined,false); } @@ -364,7 +409,9 @@ function getCurrentTXing() { name = ""; if (callsign.indexOf("$") > 0) { name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$")); - callsign = callsign.substring(0, callsign.indexOf("$")); + if (name == "$") + name = ""; + callsign = callsign.substring(0, callsign.indexOf("$")); } if (qrz == 1 && isNaN(callsign) && !qrz_blacklist.includes(callsign)) { if (name != "") { @@ -392,6 +439,8 @@ function getCurrentTXing() { name = ""; if (callsign.indexOf("$") > 0) { name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$")); + if (name == "$") + name = ""; callsign = callsign.substring(0, callsign.indexOf("$")); } if (qrz == 1 && isNaN(callsign) && !qrz_blacklist.includes(callsign)) { @@ -569,13 +618,6 @@ function getLastHeard(document, event) { } if (rowIndexes[0]) { var row = t_lh.row(rowIndexes[0]).node(); - /* - if (txing) { - $(row).addClass('red'); - } else { - $(row).removeClass('red'); - } - */ var temp = t_lh.row(rowIndexes[0]).data(); logIt("Temp: "+ temp); logIt("Duration: " + duration); diff --git a/html/js/version.js b/html/js/version.js index ca3afcb..0d399c7 100644 --- a/html/js/version.js +++ b/html/js/version.js @@ -1 +1 @@ -var dashboard_version = "2021-02-07 21:49:21"; +var dashboard_version = "2021-02-08 20:53:38";