Aufteilung in 2 Tabs

Zugriff auf ionos-Mongo
This commit is contained in:
2025-08-14 18:16:37 +00:00
parent 1da23e24c7
commit 4cffdba7df
7 changed files with 4809 additions and 74 deletions

View File

@@ -13,6 +13,36 @@ document.addEventListener('DOMContentLoaded', () => {
let editId = null;
// Modal für Fehleranzeige
function showModal(message, callback) {
// Vorherige Modals entfernen
document.querySelectorAll('.custom-modal-popup').forEach(m => m.remove());
let modal = document.createElement('div');
modal.className = 'custom-modal-popup';
let box = document.createElement('div');
box.className = 'custom-modal-box';
let msg = document.createElement('div');
msg.className = 'custom-modal-msg';
msg.textContent = message;
box.appendChild(msg);
let btn = document.createElement('button');
btn.className = 'custom-modal-btn';
btn.textContent = 'OK';
btn.onclick = () => {
if (modal.parentNode) {
modal.parentNode.removeChild(modal);
}
if (callback) callback();
};
box.appendChild(btn);
modal.appendChild(box);
document.body.appendChild(modal);
}
// Sensornummer nur Zahlen erlauben
sensorNumberInput.addEventListener('input', () => {
sensorNumberInput.value = sensorNumberInput.value.replace(/\D/g, '');
@@ -29,9 +59,20 @@ async function fetchAddressIfValid() {
addressInput.value = data.address;
} else {
addressInput.value = '';
sensorNumberInput.disabled = true;
showModal('Sensor unbekannt', () => {
sensorNumberInput.disabled = false;
sensorNumberInput.focus();
});
}
} catch (err) {
console.error('Fehler beim Abrufen der Adresse:', err);
addressInput.value = '';
sensorNumberInput.disabled = true;
showModal('Sensor unbekannt', () => {
sensorNumberInput.disabled = false;
sensorNumberInput.focus();
});
}
}
}