1
0
Fork 0

Adding textlabels for target-columns in the Dashboard configurable via html/data/TG_List.csv

main
Kim Huebel 4 years ago
parent 0a2ef0c34b
commit 990fe946c5

@ -65,7 +65,7 @@ Actually known:
Finally you should be able to get the new Dashboard calling the hostname of your hotspot and port 8000 (default) in your broser Finally you should be able to get the new Dashboard calling the hostname of your hotspot and port 8000 (default) in your broser
### Troubleshoting ### Troubleshoting
If you have any trouble running the software most things depend on the logtailer-component. So it is a good idea to try starting the software on the console wih If you have any trouble running the software most things depend on the logtailer-component. So it is a good idea to try starting the software on the console with
`python3 ./logtailer.py` to see the output of the program. A common error are missing python-libraries you should install with the commands mentioned above. `python3 ./logtailer.py` to see the output of the program. A common error are missing python-libraries you should install with the commands mentioned above.
If you found any further missing library let me know! Just open an issue! If you found any further missing library let me know! Just open an issue!
@ -78,6 +78,19 @@ Also take care to configure the filepath to the correct location of your DMRIds.
For updating the DMRIds.dat you can use the script you find in scripts-folder. For updating the DMRIds.dat you can use the script you find in scripts-folder.
### Configuration of Talkgroup-Textes in "Target"-column
You will find a file in /html/data called "TG_List.csv" that is a comma-separated file of following format:
```
TS,TG,LABEL
1,263,DL Multimode BM
2,8021,Pegasus DMR-DL
2,2625,RLP/SL BM
```
First row leave untouched for orientation. The other lines contains on first column the DMR-timeslot the TG is used, second column contains the talkgroup-number and third column contains the label you want to be shown in the target-column of the dashboard.
Please edit this file to your needs. It may change on developer-side from time by time so when updating keep a copy of your personal list to modify/edit it.
If you do not want to have this Talkgroup-textes in your dashboard, simply remove all but the first line in this file.
## Best Practise Installation ## Best Practise Installation
For getting the best user experience it is recommended to configure your MMDVMHost and other G4KLX-software with the following parameter: For getting the best user experience it is recommended to configure your MMDVMHost and other G4KLX-software with the following parameter:

@ -17,7 +17,7 @@
<!-- Bootstrap core CSS --> <!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- Bootstrap core JavaScript --> <!-- Bootstrap core JavaScript -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<!-- Datatables --> <!-- Datatables -->

@ -3,7 +3,7 @@ var ts1TXing = null;
var ts2TXing = null; var ts2TXing = null;
var ts1timestamp = ""; var ts1timestamp = "";
var ts2timestamp = ""; var ts2timestamp = "";
var talkgroups = [];
// Setting config-defaults if not set // Setting config-defaults if not set
qrz = typeof(qrz) == 'undefined' ? 1 : qrz; qrz = typeof(qrz) == 'undefined' ? 1 : qrz;
debug = typeof(debug) == 'undefined' ? 0 : debug; debug = typeof(debug) == 'undefined' ? 0 : debug;
@ -24,7 +24,7 @@ setInterval(getCurrentTXing, 1000);
function logIt(message) { function logIt(message) {
if (debug == 1 || message.startsWith("Logtailer-Errormessage:")) { if (debug == 1 || message.startsWith("Logtailer-Errormessage:")) {
console.log(message); console.log(JSON.stringify(message));
} }
} }
@ -131,6 +131,26 @@ function getRawTarget(logline) {
} }
} }
function resolveTarget(timeslot, target) {
retval = null;
tmpval = talkgroups.filter(function (tg) { return tg[0] == timeslot});
// and tg.TG == target
retval = tmpval.filter(function (tg) { return tg[1] == target.substring(3, target.length)});
if (retval.length > 0) {
return retval[0][2];
} else {
return target;
}
}
function getTimeslot(mode) {
if (mode.startsWith("DMR")) {
return mode.substring(9, 10);
} else {
return null;
}
}
function getTarget(logline) { function getTarget(logline) {
target = getRawTarget(logline); target = getRawTarget(logline);
if (showBMTGLink && getMode(logline).startsWith("DMR")) { if (showBMTGLink && getMode(logline).startsWith("DMR")) {
@ -161,11 +181,20 @@ function getTarget(logline) {
} }
} }
} else { } else {
link = '<a href="' + bmlink + linkTarget + '" target="_new">' + target + '</a>'; if (getMode(logline).startsWith("DMR")) {
return link; link = '<a href="' + bmlink + linkTarget + '" target="_new">' + resolveTarget(getTimeslot(getMode(logline)), target) + '</a>';
return link;
} else {
link = '<a href="' + bmlink + linkTarget + '" target="_new">' + target + '</a>';
return link;
}
} }
} else { } else {
return target; if (getMode(logline).startsWith("DMR")) {
return resolveTarget(getTimeslot(getMode(logline)), target);
} else {
return target;
}
} }
} }
@ -819,3 +848,21 @@ $(document).ready(function() {
activateDefaultTab("lastheard"); activateDefaultTab("lastheard");
} }
}); });
$(document).ready(function() {
$.ajax({
type: "GET",
url: 'http://mmdvm-hs-hat:8000/data/TG_List.csv',
dataType: "text",
success: function(data) {processData(data);}
});
});
function processData(data) {
var allRows = data.split(/\r?\n|\r/);
for (var singleRow = 1; singleRow < allRows.length; singleRow++) {
var rowCells = allRows[singleRow].split(',');
talkgroups.push([rowCells[0], rowCells[1], rowCells[2]]);
}
logIt("Parsed TGs: " + talkgroups);
}

@ -1 +1 @@
var dashboard_version = "2021-02-10 21:44:07"; var dashboard_version = "2021-02-13 21:34:03";

Loading…
Cancel
Save