diff --git a/html/js/config.js b/html/js/config.js index 2afe542..01df0ec 100644 --- a/html/js/config.js +++ b/html/js/config.js @@ -23,4 +23,8 @@ var showAboutTab = 1; var defaultTab = "LastHeardTab"; // Set displayed timezone and timestamp to timezone of browser if 1, else use UTC for displaying -var useClientTimezone = 1; \ No newline at end of file +var useClientTimezone = 1; + +// Show link to BrandMeister-LastHeard on TG if 1, else no link + +var showBMTGLink = 1; diff --git a/html/js/functions.js b/html/js/functions.js index 4df0d3d..5523ab4 100644 --- a/html/js/functions.js +++ b/html/js/functions.js @@ -77,7 +77,7 @@ function getCallsign(logline) { // 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 // M: 2020-11-07 15:41:22.601 DMR Slot 1, received network late entry from DO5DC to TG 262810 -function getTarget(logline) { +function getRawTarget(logline) { if(logline.indexOf("at") > 0 && logline.indexOf("late entry") < 0 ) { return logline.substring(logline.indexOf("to") + 3, logline.lastIndexOf("at")); } else { @@ -89,6 +89,18 @@ function getTarget(logline) { } } +function getTarget(logline) { + target = getRawTarget(logline); + if (showBMTGLink && getMode(logline).startsWith("DMR")) { + bmlink = "https://brandmeister.network/?page=lh&DestinationID="; + linkTarget = target.substring(3); + link = '' + target + ''; + return link; + } else { + return target; + } +} + function getSource(logline) { val = logline.substring(logline.indexOf("received") + 9); val = val.substring(0, val.indexOf(" "));