1
0
Fork 0

Added name popup-field to callsign if name is in DMRIDs.dat-file present.

Take a look at logtailer.ini - DMR_ID_Lookup is now 1 by default! take care to have a DMRIds.dat!
main
Kim Huebel 4 years ago
parent c46997c6ba
commit 17828471a6

@ -87,16 +87,29 @@ function getMode(logline) {
function getCallsign(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("$"));
}
if (qrz == 1) {
return '<a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a>';
if (name != "") {
return '<div class=\"tooltip2\"><a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a><span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
} else {
return '<a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a>';
}
} else {
return callsign;
if (name != "") {
return '<div class=\"tooltip2\">' + callsign + '<span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
} else {
return callsign;
}
}
}
function getRawTarget(logline) {
if(logline.indexOf("at") > 0 && logline.indexOf("late entry") < 0 ) {
return logline.substring(logline.indexOf("to") + 3, logline.lastIndexOf("at"));
if(logline.indexOf(" at ") > 0 && logline.indexOf("late entry") < 0 ) {
return logline.substring(logline.indexOf("to") + 3, logline.lastIndexOf(" at ") + 1);
} else {
val = logline.substring(logline.indexOf("to") + 3);
if (val.indexOf(",") > 0) {
@ -265,6 +278,28 @@ function copyToQSO(callsign) {
}
function getCallsign(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("$"));
}
if (qrz == 1) {
if (name != "") {
return '<div class=\"tooltip2\"><a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a><span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
} else {
return '<a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a>';
}
} else {
if (name != "") {
return '<div class=\"tooltip2\">' + callsign + '<span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
} else {
return callsign;
}
}
}
function getCurrentTXing() {
ts1 = null;
ts2 = null;
@ -290,6 +325,25 @@ function getCurrentTXing() {
}
t_ct.clear().draw(false);
if (ts1 != null) {
callsign = ts1[1];
name = "";
if (callsign.indexOf("$") > 0) {
name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$"));
callsign = callsign.substring(0, callsign.indexOf("$"));
}
if (qrz == 1) {
if (name != "") {
ts1[1] = '<div class=\"tooltip2\"><a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a><span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
} else {
ts1[1] = '<a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a>';
}
} else {
if (name != "") {
ts1[1] = '<div class=\"tooltip2\">' + callsign + '<span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
} else {
ts1[1] = callsign;
}
}
t_ct.row.add( [
ts1[0],
ts1[1],
@ -299,6 +353,25 @@ function getCurrentTXing() {
] ).draw(false);
}
if (ts2 != null) {
callsign = ts2[1];
name = "";
if (callsign.indexOf("$") > 0) {
name = callsign.substring(callsign.indexOf("$") + 1, callsign.lastIndexOf("$"));
callsign = callsign.substring(0, callsign.indexOf("$"));
}
if (qrz == 1) {
if (name != "") {
ts2[1] = '<div class=\"tooltip2\"><a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a><span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
} else {
ts2[1] = '<a target="_new" href="https://qrz.com/db/' + callsign + '">' + callsign + '</a>';
}
} else {
if (name != "") {
ts2[1] = '<div class=\"tooltip2\">' + callsign + '<span class=\"tooltip2text\">Name:<br>' + name + '</span></div>';
} else {
ts2[1] = callsign;
}
}
t_ct.row.add( [
ts2[0],
ts2[1],
@ -319,7 +392,7 @@ function getLastHeard(document, event) {
lines = event.data.split("\n");
var duration = 0;
lines.forEach(function(line, index, array) {
logIt(line);
logIt("LogLine: " + line);
if (line.indexOf("MMDVMHost") > 0 ) {
mmdvmhost_version = line.substring(line.indexOf("MMDVMHost"));

@ -1 +1 @@
var dashboard_version = "2021-02-03 10:37:00";
var dashboard_version = "2021-02-03 22:06:20";

@ -11,7 +11,7 @@ Filerotate=True
[MMDVMHost]
Logdir=/mnt/ramdisk/
Prefix=MMDVM
DMR_ID_Lookup=0
DMR_ID_Lookup=1
DMR_ID_LookupFile=/etc/MMDVM/DMRIds.dat
[DAPNETGateway]

@ -217,14 +217,6 @@ def log_close(websocket, path, exception=None):
def websocketserver():
''' # set first argument for the handler to current working directory
handler = functools.partial(process_request, os.getcwd())
start_server = websockets.serve(view_log, config['DEFAULT']['Host'], config['DEFAULT']['Port'], process_request=handler)
asyncio.get_event_loop().run_until_complete(start_server)
message = 'Started Websocketserver at {}:{}'.format(config['DEFAULT']['Host'], config['DEFAULT']['Port'])
logging.info(message)
asyncio.get_event_loop().run_forever()
'''
start_server = websockets.serve(view_log, config['DEFAULT']['Host'], config['DEFAULT']['Port'])
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
@ -252,7 +244,7 @@ def main():
if line.find("\t"):
separator = "\t"
tokens = line.split(separator)
dmrids[tokens[0]] = tokens[1]
dmrids[tokens[0]] = tokens[1] + "$" + tokens[2].replace("\r", "").replace("\n", "") + "$"
logging.info("Starting Websocketserver")
websocketserver()

Loading…
Cancel
Save