From 407cd889cada0154faaa06ff4372e237cf260cf7 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sat, 13 Apr 2019 19:17:00 +0200 Subject: Added live counter for brute force detection --- src/main/resources/js/login.js | 7 +++++++ src/main/resources/views/login.rocker.html | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/js/login.js (limited to 'src/main/resources') diff --git a/src/main/resources/js/login.js b/src/main/resources/js/login.js new file mode 100644 index 0000000..f4e2bce --- /dev/null +++ b/src/main/resources/js/login.js @@ -0,0 +1,7 @@ +const tryAgain = document.getElementById("tryAgain"); +const countdown = document.getElementById("counter"); + +setInterval(() => { + if (Number(countdown.innerText) === 0) tryAgain.style.display = "none"; + countdown.innerText = Number(countdown.innerText) - 1; +}, 1000); diff --git a/src/main/resources/views/login.rocker.html b/src/main/resources/views/login.rocker.html index 66d9ba2..23a9aff 100644 --- a/src/main/resources/views/login.rocker.html +++ b/src/main/resources/views/login.rocker.html @@ -1,12 +1,17 @@ -@args (String message) +@args (String message, Integer counter) +@js => { + + +} -@layout.template("Login", RockerContent.NONE, RockerContent.NONE) -> { +@layout.template("Login", RockerContent.NONE, js) -> {
} -- cgit v1.2.3