diff --git a/html/admin.html b/html/admin.html
index 2576300..ae5e3aa 100755
--- a/html/admin.html
+++ b/html/admin.html
@@ -110,6 +110,34 @@
.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;
+
+ //get local RTC
+ $.ajax({
+ url: 'launcher.php?type=RTC_time',
+ dataType: 'text', // Specify that you expect a JSON response
+ method: 'GET', // Use GET or POST depending on your needs
+ success: function(response) {
+ console.log("Local RTC: " + response);
+ const RTC_Element = document.getElementById("RTC_time");
+ RTC_Element.textContent = response;
+ },
+ error: function(xhr, status, error) {
+ console.error('AJAX request failed:', status, error);
+ }
+ });
+
+ })
+ .catch(error => console.error('Error loading config.json:', error));
+ }