changed direct backend access
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user