From 8ff0d679d912a0d18395d351810f80c5daf033d5 Mon Sep 17 00:00:00 2001 From: BlubbFish Date: Tue, 31 Aug 2021 23:02:45 +0200 Subject: [PATCH] Rename a function --- Lora-Map/resources/js/menu.js | 66 +++++++++++++++++------------------ 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Lora-Map/resources/js/menu.js b/Lora-Map/resources/js/menu.js index 763b7e3..3979e10 100644 --- a/Lora-Map/resources/js/menu.js +++ b/Lora-Map/resources/js/menu.js @@ -69,6 +69,37 @@ adminlogin.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); adminlogin.send("user=" + encodeURI(document.getElementById("pannels_admin_name").value) + "&pass=" + encodeURI(document.getElementById("pannels_admin_pass").value)); }, + UpdatePannelsInfo: function () { + document.getElementById("pannels_info").innerHTML = ""; + if (Object.prototype.hasOwnProperty.call(MarkerObject.LocationData, this.statusToDevice)) { + var positionItem = MarkerObject.LocationData[this.statusToDevice]; + var html = "
Name: " + positionItem["Name"] + "
"; + html += "
Batterie: " + positionItem["Battery"] + "V
"; + if (positionItem["Fix"]) { + html += "
GPS-Empfang
"; + } else { + html += "
kein GPS-Empfang
"; + } + html += "
" + positionItem["UTM"]["Base"] + " " + positionItem["UTM"]["FieldWidth"] + "" + positionItem["UTM"]["Width"] + " " + positionItem["UTM"]["FieldHeight"] + "" + positionItem["UTM"]["Height"] + "
"; + html += "
Höhe: " + positionItem["Height"].toFixed(1) + " m
"; + html += "
HDOP: " + positionItem["Hdop"].toFixed(1) + "
"; + html += "
Dezimal: " + positionItem["Latitude"].toFixed(5) + ", " + positionItem["Longitude"].toFixed(5) + "
"; + html += "
Letzter Wert: Vor: " + FunctionsObject.TimeCalculation(positionItem["Lastgpspostime"], "difftext") + "
"; + html += "
Update: " + FunctionsObject.TimeCalculation(positionItem["Recievedtime"], "str") + "
Vor: " + FunctionsObject.TimeCalculation(positionItem["Recievedtime"], "difftext") + "
"; + html += "
RSSI: " + positionItem["Rssi"] + ", SNR: " + positionItem["Snr"] + "
"; + if (Object.prototype.hasOwnProperty.call(MarkerObject.PanicData, this.statusToDevice)) { + var panicData = MarkerObject.PanicData[this.statusToDevice]; + if (panicData["ButtonPressed"].length > 0) { + html += "
Alerts:"; + for (var i = 0; i < panicData["ButtonPressed"].length; i++) { + html += "" + FunctionsObject.TimeCalculation(panicData["ButtonPressed"][i], "str") + " (vor " + FunctionsObject.TimeCalculation(panicData["ButtonPressed"][i], "difftext") + ")"; + } + html += "
"; + } + } + document.getElementById("pannels_info").innerHTML = html; + } + }, UpdateStatus: function () { for (var id in MarkerObject.LocationData) { if (Object.prototype.hasOwnProperty.call(MarkerObject.LocationData, id)) { @@ -88,7 +119,7 @@ } this._UpdateOverviewElement(positionItem, id); } - } + } }, /// private functions _UpdateOverviewElement: function (positionItem, id) { @@ -159,37 +190,6 @@ document.getElementById("pannels_admin").innerHTML = "Adminpannel"; } }, - _Update_pannels_info: function () { - document.getElementById("pannels_info").innerHTML = ""; - if (Object.prototype.hasOwnProperty.call(MarkerObject.LocationData, this.statusToDevice)) { - var positionItem = MarkerObject.LocationData[this.statusToDevice]; - var html = "
Name: " + positionItem["Name"] + "
"; - html += "
Batterie: " + positionItem["Battery"] + "V
"; - if (positionItem["Fix"]) { - html += "
GPS-Empfang
"; - } else { - html += "
kein GPS-Empfang
"; - } - html += "
" + positionItem["UTM"]["Base"] + " " + positionItem["UTM"]["FieldWidth"] + "" + positionItem["UTM"]["Width"] + " " + positionItem["UTM"]["FieldHeight"] + "" + positionItem["UTM"]["Height"] + "
"; - html += "
Höhe: " + positionItem["Height"].toFixed(1) + " m
"; - html += "
HDOP: " + positionItem["Hdop"].toFixed(1) + "
"; - html += "
Dezimal: " + positionItem["Latitude"].toFixed(5) + ", " + positionItem["Longitude"].toFixed(5) + "
"; - html += "
Letzter Wert: Vor: " + FunctionsObject.TimeCalculation(positionItem["Lastgpspostime"], "difftext") + "
"; - html += "
Update: " + FunctionsObject.TimeCalculation(positionItem["Recievedtime"], "str") + "
Vor: " + FunctionsObject.TimeCalculation(positionItem["Recievedtime"], "difftext") + "
"; - html += "
RSSI: " + positionItem["Rssi"] + ", SNR: " + positionItem["Snr"] + "
"; - if (Object.prototype.hasOwnProperty.call(MarkerObject.PanicData, this.statusToDevice)) { - var panicData = MarkerObject.PanicData[this.statusToDevice]; - if (panicData["ButtonPressed"].length > 0) { - html += "
Alerts:"; - for (var i = 0; i < panicData["ButtonPressed"].length; i++) { - html += "" + FunctionsObject.TimeCalculation(panicData["ButtonPressed"][i], "str") + " (vor " + FunctionsObject.TimeCalculation(panicData["ButtonPressed"][i], "difftext") + ")"; - } - html += "
"; - } - } - document.getElementById("pannels_info").innerHTML = html; - } - }, _Update_pannels_admin: function () { var testadmin = new XMLHttpRequest(); testadmin.onreadystatechange = function () { @@ -207,7 +207,7 @@ var html = ""; for (var i = 0; i < json.length; i++) { var walert = json[i]; - html += "
" + + html += "
" + "" + walert.Headline + "" + "" + walert.Location + "" + "" + walert.Body + (walert.Instructions !== "" ? "

" + walert.Instructions : "") + "
" +