This commit is contained in:
PaulVua
2025-01-20 13:21:54 +01:00
parent 4d45e34a21
commit 8ebf8dac51
9 changed files with 91 additions and 7 deletions

View File

@@ -56,7 +56,8 @@
<div class="col-lg-6 col-12">
<div class="card" style="height: 80vh;">
<div class="card-header">
Loop logs
Loop logs <button type="submit" class="btn btn-secondary btn-sm" onclick="clear_loopLogs()">Clear</button>
</div>
<div class="card-body overflow-auto" id="card_loop_content">
@@ -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);
}
});
}
</script>
</body>