@@ -172,6 +173,14 @@ window.onload = function() {
//get device ID
const deviceID = data.deviceID.trim().toUpperCase();
document.getElementById('pageTitle_plus_ID').innerText = 'token: ' + deviceID;
+ //get device Name
+ const deviceName = data.deviceName;
+
+ const elements = document.querySelectorAll('.sideBar_sensorName');
+ elements.forEach((element) => {
+ element.innerText = deviceName;
+ });
+
//get local RTC
$.ajax({
@@ -191,6 +200,27 @@ window.onload = function() {
})
.catch(error => console.error('Error loading config.json:', error));
}
+
+
+function clear_loopLogs(){
+ console.log("Clearing loop logs");
+
+ $.ajax({
+ url: 'launcher.php?type=clear_loopLogs',
+ method: 'GET', // Use GET or POST depending on your needs
+ success: function(response) {
+ // Handle success response if needed
+ console.log(response);
+ //alert(response);
+ // Reload the page after the device update
+ location.reload(); // This will reload the page
+
+ },
+ error: function(xhr, status, error) {
+ console.error('AJAX request failed:', status, error);
+ }
+ });
+ }