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

@@ -100,16 +100,29 @@
})
.catch(error => console.error(`Error loading ${file}:`, error));
});
});
window.onload = function() {
fetch('../config.json') // Replace 'deviceID.txt' with 'config.json'
.then(response => response.json()) // Parse response as JSON
.then(data => {
console.log("Getting config file (onload)");
//get device ID
const deviceID = data.deviceID.trim().toUpperCase();
document.getElementById('pageTitle_plus_ID').innerText = 'token: ' + deviceID;
//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({