mirror of
https://github.com/pi-hole/web.git
synced 2026-05-08 09:39:05 +01:00
Remove session timer leftovers
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
@@ -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")) {
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user