1
0
Fork 0

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

main
Kim Huebel 4 years ago
parent c926da435d
commit cf76ef5ac3

@ -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",
]

@ -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,190 +428,192 @@ 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); if (line.indexOf("description:") > 0 ) {
document.getElementById("dmrid").innerHTML = dmrid; modem = line.substring(line.indexOf("description:") + 12);
} document.getElementById("modem").innerHTML = modem;
}
if (line.indexOf("RX Frequency:") > 0 ) { if (line.indexOf("Callsign:") > 0 ) {
rxqrg = line.substring(line.indexOf("RX Frequency:") + 14, 54); callsign = line.substring(line.indexOf("Callsign:") + 10);
document.getElementById("rxqrg").innerHTML = getMHZ(rxqrg) + " MHz"; document.getElementById("callsign").innerHTML = callsign;
} }
if (line.indexOf("TX Frequency:") > 0 ) { if (line.indexOf("Id:") > 0 ) {
txqrg = line.substring(line.indexOf("TX Frequency:") + 14, 54); dmrid = line.substring(line.indexOf("Id:") + 4);
document.getElementById("txqrg").innerHTML = getMHZ(txqrg) + " MHz"; document.getElementById("dmrid").innerHTML = dmrid;
} }
txing = false; if (line.indexOf("RX Frequency:") > 0 ) {
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)) { rxqrg = line.substring(line.indexOf("RX Frequency:") + 14, 54);
if (line.indexOf("received network data") > 0 || line.indexOf("late entry") > 0 || line.indexOf("voice header") > 0 || line.indexOf("received RF header") > 0) { document.getElementById("rxqrg").innerHTML = getMHZ(rxqrg) + " MHz";
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) { if (line.indexOf("TX Frequency:") > 0 ) {
logIt("Network Watchdog!"); txqrg = line.substring(line.indexOf("TX Frequency:") + 14, 54);
document.getElementById("txqrg").innerHTML = getMHZ(txqrg) + " MHz";
}
var rowIndexes = []; txing = false;
t_lh.rows( function ( idx, data, node ) { 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 (getMode(line) == "DMR Slot 1" ) { if (line.indexOf("received network data") > 0 || line.indexOf("late entry") > 0 || line.indexOf("voice header") > 0 || line.indexOf("received RF header") > 0) {
if(data[0] == getLocaltimeFromTimestamp(ts1timestamp)){ txing = true;
rowIndexes.push(idx);
}
return false;
} else {
if(data[0] == getLocaltimeFromTimestamp(ts2timestamp)){
rowIndexes.push(idx);
}
}
});
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 (line.indexOf("network watchdog") > 0 || line.indexOf("end of voice transmission") > 0 || line.indexOf("end of transmission") > 0) {
if (rowIndexes[0] == "0") { if (getMode(line) == "DMR Slot 1" ) {
t_lh.row(rowIndexes[0]).remove().draw(false); ts1TXing = null;
} } else {
logIt("RowIndex[0]: " + rowIndexes[0]); ts2TXing = null;
if (t_lh.row(rowIndexes[0]).data[0] != null) { }
newData = [ txing = false;
t_lh.row(rowIndexes[0]).data[0],
t_lh.row(rowIndexes[0]).data[1], if (line.indexOf("network watchdog") > 0) {
t_lh.row(rowIndexes[0]).data[2], logIt("Network Watchdog!");
t_lh.row(rowIndexes[0]).data[3],
t_lh.row(rowIndexes[0]).data[4], var rowIndexes = [];
duration, t_lh.rows( function ( idx, data, node ) {
"", if (getMode(line) == "DMR Slot 1" ) {
"", if(data[0] == getLocaltimeFromTimestamp(ts1timestamp)){
getAddToQSO(line) rowIndexes.push(idx);
] }
logIt(t_lh.row(rowIndexes[0]).data[2]) return false;
$('#lastHeard').dataTable().fnUpdate(newData,rowIndexes[0],undefined,false); } else {
if(data[0] == getLocaltimeFromTimestamp(ts2timestamp)){
rowIndexes.push(idx);
}
}
});
if (getMode(line) == "DMR Slot 1" ) {
duration = Math.round(Date.parse(getRawTimestamp(line).replace(" ","T")+".000Z")/1000 - Date.parse(ts1timestamp.replace(" ","T")+".000Z")/1000);
} else { } else {
logIt("Problem replacing watchdog! Indices: " + rowIndexes); duration = Math.round(Date.parse(getRawTimestamp(line).replace(" ","T")+".000Z")/1000 - Date.parse(ts2timestamp.replace(" ","T")+".000Z")/1000);
}
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);
}
} }
} }
} }
} logIt("TS1: " + ts1TXing + "|" + ts1timestamp);
logIt("TS1: " + ts1TXing + "|" + ts1timestamp); logIt("TS2: " + ts2TXing + "|" + ts2timestamp);
logIt("TS2: " + ts2TXing + "|" + ts2timestamp); getCurrentTXing();
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]) {
if (line.indexOf("network watchdog") < 0 ) { newData = [
var rowIndexes = [], timestamp,
timestamp = getTimestamp(line), mode,
mode = getMode(line), callsign,
callsign = getCallsign(line), target,
target = getTarget(line), source,
source = getSource(line), duration,
duration = getDuration(line), loss,
loss = getLoss(line), ber,
ber = getBER(line), addToQSO
addToQSO = getAddToQSO(line); ]
if (txing) { t_lh.row(rowIndexes[0]).data( newData ).draw(false);
duration = "TXing"; } else {
loss = ""; t_lh.row.add( [
ber = ""; timestamp,
} mode,
if (mode == "POCSAG") { callsign,
callsign = "POCSAG"; target,
target = ""; source,
source = ""; duration,
duration = ""; loss,
loss = ""; ber,
ber = ""; addToQSO
addToQSO = ""; ] ).draw(false);
}
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]) { 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);
}
} }
} }
}); });

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

Loading…
Cancel
Save