1
0
Fork 0

Added Dashboard-Blacklist into config.js to avoid visibility of Callsigns listed in this

This commit is contained in:
Kim Huebel 2021-02-07 21:02:58 +00:00
parent c926da435d
commit cf76ef5ac3
3 changed files with 223 additions and 201 deletions

View file

@ -30,3 +30,9 @@ var showBMTGLink = 1;
var qrz_blacklist = [ var qrz_blacklist = [
"N0CALL", "N0CALL",
] ]
// Array of callsigns that should generally not be listed on the dashboard
var dashboard_blacklist = [
"MY0CALL",
]

View file

@ -54,6 +54,16 @@ function getTimezone() {
} }
} }
function inDashboardBlacklist(logline) {
callsign = logline.substring(logline.indexOf("from") + 5, logline.indexOf("to")).trim();
name = "";
if (callsign.indexOf("$") > 0) {
name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$"));
callsign = callsign.substring(0, callsign.indexOf("$"));
}
return dashboard_blacklist.includes(callsign);
}
function isDMRHost(logline) { function isDMRHost(logline) {
if (logline.charAt(22) == " ") if (logline.charAt(22) == " ")
return true; return true;
@ -418,191 +428,193 @@ function getLastHeard(document, event) {
var duration = 0; var duration = 0;
lines.forEach(function(line, index, array) { lines.forEach(function(line, index, array) {
logIt("LogLine: " + line); logIt("LogLine: " + line);
/* if (!inDashboardBlacklist(line)) {
if (line.indexOf("MMDVMHost") > 0 ) { /*
mmdvmhost_version = line.substring(line.indexOf("MMDVMHost")); if (line.indexOf("MMDVMHost") > 0 ) {
mmdvmhost_version = mmdvmhost_version.substring(0, mmdvmhost_version.indexOf(" ")); mmdvmhost_version = line.substring(line.indexOf("MMDVMHost"));
document.getElementById("mmdvmhost_version").innerHTML = mmdvmhost_version; mmdvmhost_version = mmdvmhost_version.substring(0, mmdvmhost_version.indexOf(" "));
} document.getElementById("mmdvmhost_version").innerHTML = mmdvmhost_version;
if (line.indexOf("Built") > 0 ) { }
built = line.substring(line.indexOf("Built") + 6); if (line.indexOf("Built") > 0 ) {
document.getElementById("built").innerHTML = built; built = line.substring(line.indexOf("Built") + 6);
} document.getElementById("built").innerHTML = built;
*/
if (line.indexOf("description:") > 0 ) {
modem = line.substring(line.indexOf("description:") + 12);
document.getElementById("modem").innerHTML = modem;
}
if (line.indexOf("Callsign:") > 0 ) {
callsign = line.substring(line.indexOf("Callsign:") + 10);
document.getElementById("callsign").innerHTML = callsign;
}
if (line.indexOf("Id:") > 0 ) {
dmrid = line.substring(line.indexOf("Id:") + 4);
document.getElementById("dmrid").innerHTML = dmrid;
}
if (line.indexOf("RX Frequency:") > 0 ) {
rxqrg = line.substring(line.indexOf("RX Frequency:") + 14, 54);
document.getElementById("rxqrg").innerHTML = getMHZ(rxqrg) + " MHz";
}
if (line.indexOf("TX Frequency:") > 0 ) {
txqrg = line.substring(line.indexOf("TX Frequency:") + 14, 54);
document.getElementById("txqrg").innerHTML = getMHZ(txqrg) + " MHz";
}
txing = false;
if (line.indexOf("Talker Alias") < 0 && line.indexOf("Downlink Activate") < 0 && line.indexOf("Preamble CSBK") < 0 && line.indexOf("data header") < 0 && line.indexOf("0000:") < 0 && line.length > 0 && (line.indexOf("received") > 0 || line.indexOf("network watchdog") > 0)) {
if (line.indexOf("received network data") > 0 || line.indexOf("late entry") > 0 || line.indexOf("voice header") > 0 || line.indexOf("received RF header") > 0) {
txing = true;
if (getMode(line) == "DMR Slot 1" ) {
ts1TXing = getMode(line) + ";" + line.substring(line.indexOf("from") + 5, line.indexOf("to")).trim() + ";" + getTarget(line) + ";" + getSource(line);
ts1timestamp = getRawTimestamp(line);
} else {
ts2TXing = getMode(line) + ";" + line.substring(line.indexOf("from") + 5, line.indexOf("to")).trim() + ";" + getTarget(line) + ";" + getSource(line);
ts2timestamp = getRawTimestamp(line);
}
} }
if (line.indexOf("network watchdog") > 0 || line.indexOf("end of voice transmission") > 0 || line.indexOf("end of transmission") > 0) {
if (getMode(line) == "DMR Slot 1" ) {
ts1TXing = null;
} else {
ts2TXing = null;
}
txing = false;
if (line.indexOf("network watchdog") > 0) { */
logIt("Network Watchdog!"); if (line.indexOf("description:") > 0 ) {
modem = line.substring(line.indexOf("description:") + 12);
document.getElementById("modem").innerHTML = modem;
}
var rowIndexes = []; if (line.indexOf("Callsign:") > 0 ) {
t_lh.rows( function ( idx, data, node ) { callsign = line.substring(line.indexOf("Callsign:") + 10);
if (getMode(line) == "DMR Slot 1" ) { document.getElementById("callsign").innerHTML = callsign;
if(data[0] == getLocaltimeFromTimestamp(ts1timestamp)){ }
rowIndexes.push(idx);
} if (line.indexOf("Id:") > 0 ) {
return false; dmrid = line.substring(line.indexOf("Id:") + 4);
} else { document.getElementById("dmrid").innerHTML = dmrid;
if(data[0] == getLocaltimeFromTimestamp(ts2timestamp)){ }
rowIndexes.push(idx);
} if (line.indexOf("RX Frequency:") > 0 ) {
} rxqrg = line.substring(line.indexOf("RX Frequency:") + 14, 54);
}); document.getElementById("rxqrg").innerHTML = getMHZ(rxqrg) + " MHz";
}
if (line.indexOf("TX Frequency:") > 0 ) {
txqrg = line.substring(line.indexOf("TX Frequency:") + 14, 54);
document.getElementById("txqrg").innerHTML = getMHZ(txqrg) + " MHz";
}
txing = false;
if (line.indexOf("Talker Alias") < 0 && line.indexOf("Downlink Activate") < 0 && line.indexOf("Preamble CSBK") < 0 && line.indexOf("data header") < 0 && line.indexOf("0000:") < 0 && line.length > 0 && (line.indexOf("received") > 0 || line.indexOf("network watchdog") > 0)) {
if (line.indexOf("received network data") > 0 || line.indexOf("late entry") > 0 || line.indexOf("voice header") > 0 || line.indexOf("received RF header") > 0) {
txing = true;
if (getMode(line) == "DMR Slot 1" ) { if (getMode(line) == "DMR Slot 1" ) {
duration = Math.round(Date.parse(getRawTimestamp(line).replace(" ","T")+".000Z")/1000 - Date.parse(ts1timestamp.replace(" ","T")+".000Z")/1000); ts1TXing = getMode(line) + ";" + line.substring(line.indexOf("from") + 5, line.indexOf("to")).trim() + ";" + getTarget(line) + ";" + getSource(line);
ts1timestamp = getRawTimestamp(line);
} else { } else {
duration = Math.round(Date.parse(getRawTimestamp(line).replace(" ","T")+".000Z")/1000 - Date.parse(ts2timestamp.replace(" ","T")+".000Z")/1000); ts2TXing = getMode(line) + ";" + line.substring(line.indexOf("from") + 5, line.indexOf("to")).trim() + ";" + getTarget(line) + ";" + getSource(line);
} ts2timestamp = getRawTimestamp(line);
logIt("RowIndexes: " + rowIndexes);
if (rowIndexes[0]) {
if (rowIndexes[0] == "0") {
t_lh.row(rowIndexes[0]).remove().draw(false);
}
logIt("RowIndex[0]: " + rowIndexes[0]);
if (t_lh.row(rowIndexes[0]).data[0] != null) {
newData = [
t_lh.row(rowIndexes[0]).data[0],
t_lh.row(rowIndexes[0]).data[1],
t_lh.row(rowIndexes[0]).data[2],
t_lh.row(rowIndexes[0]).data[3],
t_lh.row(rowIndexes[0]).data[4],
duration,
"",
"",
getAddToQSO(line)
]
logIt(t_lh.row(rowIndexes[0]).data[2])
$('#lastHeard').dataTable().fnUpdate(newData,rowIndexes[0],undefined,false);
} else {
logIt("Problem replacing watchdog! Indices: " + rowIndexes);
}
} }
} }
} if (line.indexOf("network watchdog") > 0 || line.indexOf("end of voice transmission") > 0 || line.indexOf("end of transmission") > 0) {
logIt("TS1: " + ts1TXing + "|" + ts1timestamp); if (getMode(line) == "DMR Slot 1" ) {
logIt("TS2: " + ts2TXing + "|" + ts2timestamp); ts1TXing = null;
getCurrentTXing(); } else {
ts2TXing = null;
}
txing = false;
if (line.indexOf("network watchdog") < 0 ) { if (line.indexOf("network watchdog") > 0) {
var rowIndexes = [], logIt("Network Watchdog!");
timestamp = getTimestamp(line),
mode = getMode(line), var rowIndexes = [];
callsign = getCallsign(line), t_lh.rows( function ( idx, data, node ) {
target = getTarget(line), if (getMode(line) == "DMR Slot 1" ) {
source = getSource(line), if(data[0] == getLocaltimeFromTimestamp(ts1timestamp)){
duration = getDuration(line), rowIndexes.push(idx);
loss = getLoss(line), }
ber = getBER(line), return false;
addToQSO = getAddToQSO(line); } else {
if (txing) { if(data[0] == getLocaltimeFromTimestamp(ts2timestamp)){
duration = "TXing"; rowIndexes.push(idx);
loss = ""; }
ber = ""; }
} });
if (mode == "POCSAG") { if (getMode(line) == "DMR Slot 1" ) {
callsign = "POCSAG"; duration = Math.round(Date.parse(getRawTimestamp(line).replace(" ","T")+".000Z")/1000 - Date.parse(ts1timestamp.replace(" ","T")+".000Z")/1000);
target = ""; } else {
source = ""; duration = Math.round(Date.parse(getRawTimestamp(line).replace(" ","T")+".000Z")/1000 - Date.parse(ts2timestamp.replace(" ","T")+".000Z")/1000);
duration = ""; }
loss = ""; logIt("RowIndexes: " + rowIndexes);
ber = ""; if (rowIndexes[0]) {
addToQSO = ""; if (rowIndexes[0] == "0") {
} t_lh.row(rowIndexes[0]).remove().draw(false);
t_lh.rows( function ( idx, data, node ) { }
if(data[2] == callsign){ logIt("RowIndex[0]: " + rowIndexes[0]);
rowIndexes.push(idx); if (t_lh.row(rowIndexes[0]).data[0] != null) {
newData = [
t_lh.row(rowIndexes[0]).data[0],
t_lh.row(rowIndexes[0]).data[1],
t_lh.row(rowIndexes[0]).data[2],
t_lh.row(rowIndexes[0]).data[3],
t_lh.row(rowIndexes[0]).data[4],
duration,
"",
"",
getAddToQSO(line)
]
logIt(t_lh.row(rowIndexes[0]).data[2])
$('#lastHeard').dataTable().fnUpdate(newData,rowIndexes[0],undefined,false);
} else {
logIt("Problem replacing watchdog! Indices: " + rowIndexes);
}
}
}
}
logIt("TS1: " + ts1TXing + "|" + ts1timestamp);
logIt("TS2: " + ts2TXing + "|" + ts2timestamp);
getCurrentTXing();
if (line.indexOf("network watchdog") < 0 ) {
var rowIndexes = [],
timestamp = getTimestamp(line),
mode = getMode(line),
callsign = getCallsign(line),
target = getTarget(line),
source = getSource(line),
duration = getDuration(line),
loss = getLoss(line),
ber = getBER(line),
addToQSO = getAddToQSO(line);
if (txing) {
duration = "TXing";
loss = "";
ber = "";
}
if (mode == "POCSAG") {
callsign = "POCSAG";
target = "";
source = "";
duration = "";
loss = "";
ber = "";
addToQSO = "";
}
t_lh.rows( function ( idx, data, node ) {
if(data[2] == callsign){
rowIndexes.push(idx);
}
return false;
});
if (rowIndexes[0] == "0") {
t_lh.row(rowIndexes[0]).remove().draw(false);
}
if (rowIndexes[0]) {
newData = [
timestamp,
mode,
callsign,
target,
source,
duration,
loss,
ber,
addToQSO
]
t_lh.row(rowIndexes[0]).data( newData ).draw(false);
} else {
t_lh.row.add( [
timestamp,
mode,
callsign,
target,
source,
duration,
loss,
ber,
addToQSO
] ).draw(false);
} }
return false;
});
if (rowIndexes[0] == "0") {
t_lh.row(rowIndexes[0]).remove().draw(false);
} }
if (rowIndexes[0]) { if (rowIndexes[0]) {
var row = t_lh.row(rowIndexes[0]).node();
newData = [ /*
timestamp, if (txing) {
mode, $(row).addClass('red');
callsign, } else {
target, $(row).removeClass('red');
source, }
duration, */
loss, var temp = t_lh.row(rowIndexes[0]).data();
ber, logIt("Temp: "+ temp);
addToQSO logIt("Duration: " + duration);
] temp[5] = duration;
t_lh.row(rowIndexes[0]).data( newData ).draw(false); $('#lastHeard').dataTable().fnUpdate(temp,rowIndexes[0],undefined,false);
} else {
t_lh.row.add( [
timestamp,
mode,
callsign,
target,
source,
duration,
loss,
ber,
addToQSO
] ).draw(false);
} }
} }
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);
temp[5] = duration;
$('#lastHeard').dataTable().fnUpdate(temp,rowIndexes[0],undefined,false);
}
} }
}); });
}); });
@ -613,17 +625,19 @@ function getLocalHeard(document, event) {
$(document).ready(function() { $(document).ready(function() {
lines = event.data.split("\n"); lines = event.data.split("\n");
lines.forEach(function(line, index, array) { lines.forEach(function(line, index, array) {
if (getSource(line) == "RF") { if (!inDashboardBlacklist(line)) {
if (getDuration(line) !== "") { if (getSource(line) == "RF") {
t_localh.row.add( [ if (getDuration(line) !== "") {
getTimestamp(line), t_localh.row.add( [
getMode(line), getTimestamp(line),
getCallsign(line), getMode(line),
getTarget(line), getCallsign(line),
getSource(line), getTarget(line),
getDuration(line), getSource(line),
getBER(line) getDuration(line),
] ).draw(false); getBER(line)
] ).draw(false);
}
} }
} }
}); });
@ -634,18 +648,20 @@ function getAllHeard(document, event) {
$(document).ready(function() { $(document).ready(function() {
lines = event.data.split("\n"); lines = event.data.split("\n");
lines.forEach(function(line, index, array) { lines.forEach(function(line, index, array) {
if (line.indexOf("network watchdog") < 0 ) { if (!inDashboardBlacklist(line)) {
if (getDuration(line) !== "") { if (line.indexOf("network watchdog") < 0 ) {
t_allh.row.add( [ if (getDuration(line) !== "") {
getTimestamp(line), t_allh.row.add( [
getMode(line), getTimestamp(line),
getCallsign(line), getMode(line),
getTarget(line), getCallsign(line),
getSource(line), getTarget(line),
getDuration(line), getSource(line),
getLoss(line), getDuration(line),
getBER(line) getLoss(line),
] ).draw(false); getBER(line)
] ).draw(false);
}
} }
} }
}); });

View file

@ -1 +1 @@
var dashboard_version = "2021-02-06 23:30:37"; var dashboard_version = "2021-02-07 21:02:58";