mirror of
https://github.com/pi-hole/web.git
synced 2026-05-03 23:18:12 +01:00
@@ -140,6 +140,35 @@ $("#DHCPchk").click(function() {
|
||||
$("#dhcpnotice").prop("hidden", !this.checked).addClass("lookatme");
|
||||
});
|
||||
|
||||
function loadCacheInfo()
|
||||
{
|
||||
$.getJSON("api.php?getCacheInfo", function(data) {
|
||||
if("FTLnotrunning" in data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Fill table with obtained values
|
||||
$("#cache-size").text(parseInt(data["cacheinfo"]["cache-size"]));
|
||||
$("#cache-inserted").text(parseInt(data["cacheinfo"]["cache-inserted"]));
|
||||
|
||||
// Highlight early cache removals when present
|
||||
var cachelivefreed = parseInt(data["cacheinfo"]["cache-live-freed"]);
|
||||
$("#cache-live-freed").text(cachelivefreed);
|
||||
if(cachelivefreed > 0)
|
||||
{
|
||||
$("#cache-live-freed").parent("tr").addClass("lookatme");
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#cache-live-freed").parent("tr").removeClass("lookatme")
|
||||
}
|
||||
|
||||
// Update cache info every 10 seconds
|
||||
setTimeout(loadCacheInfo, 10000);
|
||||
});
|
||||
}
|
||||
|
||||
var leasetable, staticleasetable;
|
||||
$(document).ready(function() {
|
||||
if(document.getElementById("DHCPLeasesTable"))
|
||||
@@ -170,6 +199,8 @@ $(document).ready(function() {
|
||||
staticleasetable.draw();
|
||||
});
|
||||
|
||||
loadCacheInfo();
|
||||
|
||||
} );
|
||||
|
||||
// Handle hiding of alerts
|
||||
|
||||
Reference in New Issue
Block a user