Merge remote-tracking branch 'int/dev' into dev
This commit is contained in:
94
index.html
94
index.html
@@ -47,65 +47,59 @@
|
|||||||
</table>
|
</table>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function() {
|
(function() {
|
||||||
|
const queryString = window.location.search;
|
||||||
|
const urlParams = new URLSearchParams(queryString);
|
||||||
|
const filter = urlParams.get('call') || '';
|
||||||
const tableBody = document.getElementById('messagesTable').querySelector('tbody');
|
const tableBody = document.getElementById('messagesTable').querySelector('tbody');
|
||||||
var lines = 0;
|
var lines = 0;
|
||||||
var buffer = $('#mqtt');
|
var buffer = $('#mqtt');
|
||||||
var socket = io.connect("/"); // http://localhost:8000");
|
var socket = io.connect("/"); // http://localhost:8000");
|
||||||
socket.on('connect', function() {
|
socket.on('connect', function() {
|
||||||
console.log('Connected to:', socket.host);
|
console.log('Connected to:', socket.host);
|
||||||
});
|
});
|
||||||
socket.on('mqtt', function(message) {
|
socket.on('mqtt', function(message) {
|
||||||
try {
|
if ((filter == '') || (filter == message.station_call)) {
|
||||||
showit=JSON.stringify(message);
|
const row = document.createElement('tr');
|
||||||
} catch {};
|
const timestampCell = document.createElement('td');
|
||||||
const row = document.createElement('tr');
|
const CellCall = document.createElement('td');
|
||||||
const timestampCell = document.createElement('td');
|
const CellGrid = document.createElement('td');
|
||||||
const CellCall = document.createElement('td');
|
const CellStationCall = document.createElement('td');
|
||||||
const CellGrid = document.createElement('td');
|
const CellStationGrid = document.createElement('td');
|
||||||
const CellStationCall = document.createElement('td');
|
const CellBand = document.createElement('td');
|
||||||
const CellStationGrid = document.createElement('td');
|
const CellQRG = document.createElement('td');
|
||||||
const CellBand = document.createElement('td');
|
const CellMode = document.createElement('td');
|
||||||
const CellQRG = document.createElement('td');
|
const CellRSTR = document.createElement('td');
|
||||||
const CellMode = document.createElement('td');
|
const CellRSTS = document.createElement('td');
|
||||||
const CellRSTR = document.createElement('td');
|
|
||||||
const CellRSTS = document.createElement('td');
|
|
||||||
|
|
||||||
CellCall.textContent = message.call;
|
CellCall.textContent = message.call;
|
||||||
CellGrid.textContent = message.grid;
|
CellGrid.textContent = message.grid;
|
||||||
CellStationCall.textContent = message.station_call;
|
CellStationCall.textContent = message.station_call;
|
||||||
CellStationGrid.textContent = message.station_grid;
|
CellStationGrid.textContent = message.station_grid;
|
||||||
CellBand.textContent = message.band;
|
CellBand.textContent = message.band;
|
||||||
CellQRG.textContent = message.qrg;
|
CellQRG.textContent = message.qrg;
|
||||||
CellMode.textContent = message.mode;
|
CellMode.textContent = message.mode;
|
||||||
CellRSTR.textContent = message.RST_RCVD;
|
CellRSTR.textContent = message.RST_RCVD;
|
||||||
CellRSTS.textContent = message.RST_SENT;
|
CellRSTS.textContent = message.RST_SENT;
|
||||||
timestampCell.textContent = tsclean(message.qso_time);
|
timestampCell.textContent = tsclean(message.qso_time);
|
||||||
|
|
||||||
row.appendChild(timestampCell);
|
row.appendChild(timestampCell);
|
||||||
row.appendChild(CellStationCall);
|
row.appendChild(CellStationCall);
|
||||||
row.appendChild(CellStationGrid);
|
row.appendChild(CellStationGrid);
|
||||||
row.appendChild(CellCall);
|
row.appendChild(CellCall);
|
||||||
row.appendChild(CellGrid);
|
row.appendChild(CellGrid);
|
||||||
row.appendChild(CellBand);
|
row.appendChild(CellBand);
|
||||||
row.appendChild(CellQRG);
|
row.appendChild(CellQRG);
|
||||||
row.appendChild(CellMode);
|
row.appendChild(CellMode);
|
||||||
row.appendChild(CellRSTR);
|
row.appendChild(CellRSTR);
|
||||||
row.appendChild(CellRSTS);
|
row.appendChild(CellRSTS);
|
||||||
row.classList.add('new-row');
|
row.classList.add('new-row');
|
||||||
tableBody.insertBefore(row, tableBody.firstChild);
|
tableBody.insertBefore(row, tableBody.firstChild);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
row.classList.remove('new-row');
|
row.classList.remove('new-row');
|
||||||
}, 1500);
|
}, 1500);
|
||||||
|
}
|
||||||
});
|
|
||||||
|
|
||||||
/*
|
|
||||||
$( "#i_topic" ).change(function() {
|
|
||||||
socket.emit("wishtopic",this.value);
|
|
||||||
$('#mqtt').empty();
|
|
||||||
});
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
});
|
||||||
})();
|
})();
|
||||||
function tsclean(timestamp) {
|
function tsclean(timestamp) {
|
||||||
const parts = timestamp.split(':');
|
const parts = timestamp.split(':');
|
||||||
|
|||||||
2
mqtt.js
2
mqtt.js
@@ -56,7 +56,7 @@ mqttC.on('message', function (topic, message) { // Handler, wenn mqtt-message ko
|
|||||||
} else {
|
} else {
|
||||||
tobrowser=parse_cat_msg(topic,msg.content);
|
tobrowser=parse_cat_msg(topic,msg.content);
|
||||||
// io.emit("cat",tobrowser); // und raus an den Browser (nur fuer DIESES Socket, nicht fuer alle Clients) damit
|
// io.emit("cat",tobrowser); // und raus an den Browser (nur fuer DIESES Socket, nicht fuer alle Clients) damit
|
||||||
console.log(topic+' / CAT for User '+tobrowser.user_id+' at '+tobrowser.qrg+' in Mode '+tobrowser.mode);
|
console.log(topic+' / CAT for User '+tobrowser.user_id+' ('+msg.content.user_name+') at '+tobrowser.qrg+' in Mode '+tobrowser.mode);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(msg.content.user_name+' not in Whitelist');
|
console.log(msg.content.user_name+' not in Whitelist');
|
||||||
|
|||||||
Reference in New Issue
Block a user