changed direct backend access

This commit is contained in:
Carsten Graf
2025-06-13 23:11:58 +02:00
parent b6fa2d69e7
commit abedcc8fb1
5 changed files with 58 additions and 30 deletions

View File

@@ -66,6 +66,8 @@
// Globale Variablen
let rfidData = [];
let isLoading = false;
let DBUrl = "db.reptilfpv.de:3000";
var APIKey;
// Maximales Datum auf heute setzen
document.addEventListener('DOMContentLoaded', function() {
@@ -244,6 +246,7 @@
window.addEventListener('load', function() {
document.getElementById('uid').focus();
checkServerStatus();
loadLicence();
});
// Enter-Taste in UID Feld zum nächsten Feld springen
@@ -333,7 +336,7 @@
async function checkServerStatus() {
try {
const response = await fetch('/api/health');
const response = await fetch('/api/health');
const data = await response.json();
if (!data.status || data.status !== 'connected') {
@@ -348,6 +351,18 @@
return false;
}
}
function loadLicence() {
fetch("/api/get-licence")
.then((response) => response.json())
.then((data) => {
APIKey = data.licence || "";
})
.catch((error) =>
showMessage("Fehler beim Laden der Lizenz", "error")
);
}
</script>
</body>
</html>