mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Completely hide session timer if there is no session (i.e. no password set)
This commit is contained in:
+1
-1
@@ -125,7 +125,7 @@
|
||||
<div class="col-xs-4 text-center">
|
||||
<a href="https://github.com/pi-hole/pi-hole/releases">Updates</a>
|
||||
</div>
|
||||
<div class="col-xs-12 text-center">Session is valid for <span id="sessiontimer"><?php if(strlen($pwhash) > 0){echo $maxlifetime;}else{echo "0";} ?></span></div>
|
||||
<div class="col-xs-12 text-center" id="sessiontimer">Session is valid for <span id="sessiontimercounter"><?php if(strlen($pwhash) > 0){echo $maxlifetime;}else{echo "0";} ?></span></div>
|
||||
</li>
|
||||
<!-- Menu Footer -->
|
||||
<li class="user-footer">
|
||||
|
||||
+6
-2
@@ -57,7 +57,7 @@ if(piholeVersion !== "vDev" && versionCompare(piholeVersion, "v2.7") < 0)
|
||||
alert("Pi-hole needs to be updated to at least v2.7 before you can use features such as whitelisting/blacklisting from this web interface!")
|
||||
|
||||
// Session timer
|
||||
var sessionvalidity = parseInt(document.getElementById("sessiontimer").textContent);
|
||||
var sessionvalidity = parseInt(document.getElementById("sessiontimercounter").textContent);
|
||||
var start = new Date;
|
||||
|
||||
function updateSessionTimer()
|
||||
@@ -86,8 +86,12 @@ if(sessionvalidity > 0)
|
||||
if(seconds < 10) seconds = "0" + seconds;
|
||||
|
||||
var currentTimeString = minutes + ":" + seconds;
|
||||
document.getElementById("sessiontimer").textContent = currentTimeString;
|
||||
document.getElementById("sessiontimercounter").textContent = currentTimeString;
|
||||
|
||||
$('.timer').text(currentTimeString);
|
||||
}, 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("sessiontimer").style.display = 'none';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user