From 82e354f3813916d8581c88e21b3668f48bcdad80 Mon Sep 17 00:00:00 2001 From: Oskar Date: Wed, 9 Dec 2020 17:19:04 +0100 Subject: [PATCH] Add option to abort signin on error and notification if signin is likely a double signin. Resolves #17. --- web/index.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index 42f39a9..b1756b6 100644 --- a/web/index.html +++ b/web/index.html @@ -51,7 +51,7 @@ color: #000; width: calc(100% - 32px); } - input[type=submit] { + input[type=submit], input[type=button] { background: #c50e1f; text-transform: uppercase; font-weight: bold; @@ -271,11 +271,15 @@ var aInfo = '' var minD = '' + var doubleT = '' if (json.request == 'departure') { var d = new Date(json.arrival.time) var dInfo = d.toString('en-GB').split(' ').slice(0,5).join(' ') aInfo = `Your last arrival was on ${dInfo} in room ${json.arrival.room}.` minD = `min="${localISOTimeMinutes(d)}"` + if (new Date() - d < 3 * 60 * 1000) { + doubleT = 'Your last sign in was less than 3 minutes ago. You might be accidentally trying to sign in twice. If you don\'t intend to log 2 arrivals within the last 3 minutes, please abort below.' + } } var now = localISOTimeMinutes(new Date()) @@ -289,7 +293,9 @@ ${aInfo} + ${doubleT} + `