added password counter
All checks were successful
Docker Release Build / push_to_registry (push) Successful in 58s

This commit is contained in:
Florian Walther
2026-02-07 23:45:57 +01:00
parent 8869db0f6b
commit 13c791b1ae
6 changed files with 153 additions and 31 deletions

View File

@@ -17,13 +17,22 @@
}
function generateNewPassword() {
fetch("/api/password")
.then(response => response.text())
.then(password => {
document.getElementById("password").innerText = password;
})
.catch(error => console.error("Fehler:", error));
}
fetch("/json/password")
.then(response => response.json()) // Jetzt .json() statt .text()
.then(data => {
// Passwort aktualisieren
document.getElementById("password").innerText = data.password;
// Counter im Footer aktualisieren
// Wir suchen das Element mit der Klasse 'badge-blue' (oder gib ihm eine ID)
const counterElement = document.querySelector(".badge-blue");
if (counterElement) {
//counterElement.innerText = data.count;
document.getElementById("global-counter").innerText = data.count;
}
})
.catch(error => console.error("Fehler:", error));
}
</script>
{{ end }}