Remove session timer leftovers

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König
2022-08-13 11:16:56 +02:00
parent 17857841ab
commit 1fdb5e7475
2 changed files with 1 additions and 41 deletions
-38
View File
@@ -255,44 +255,6 @@ $("#pihole-disable-custom").on("click", function (e) {
piholeChange("disable", custVal);
});
// Session timer
function updateSessionTimer() {
start = new Date();
start.setSeconds(start.getSeconds() + sessionvalidity);
}
var sessionTimerCounter, sessionvalidity, start;
var sessiontimer = document.getElementById("sessiontimer");
if (sessiontimer) {
sessionTimerCounter = document.getElementById("sessiontimercounter");
sessionvalidity = parseInt(sessionTimerCounter.textContent, 10);
start = new Date();
if (sessionvalidity > 0) {
// setSeconds will correctly handle wrap-around cases
updateSessionTimer();
setInterval(function () {
var current = new Date();
var totalseconds = (start - current) / 1000;
var minutes = Math.floor(totalseconds / 60);
if (minutes < 10) {
minutes = "0" + minutes;
}
var seconds = Math.floor(totalseconds % 60);
if (seconds < 10) {
seconds = "0" + seconds;
}
sessionTimerCounter.textContent = totalseconds > 0 ? minutes + ":" + seconds : "-- : --";
}, 1000);
} else {
sessiontimer.style.display = "none";
}
}
// Handle Ctrl + Enter button on Login page
$(document).keypress(function (e) {
if ((e.keyCode === 10 || e.keyCode === 13) && e.ctrlKey && $("#loginpw").is(":focus")) {
+1 -3
View File
@@ -5,7 +5,7 @@
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
/* global utils:false, Chart:false, updateSessionTimer:false */
/* global utils:false, Chart:false */
// Define global variables
var timeLineChart, clientsChart;
@@ -774,8 +774,6 @@ function updateSummaryData(runOnce) {
};
$.getJSON("api.php?summaryRaw", function (data) {
updateSessionTimer();
if ("FTLnotrunning" in data) {
data.dns_queries_today = "Lost";
data.ads_blocked_today = "connection";