-
-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291 from pi-hole/devel
NEW RELEASE BECAUSE GITHUBS TAGGING IS A BIT BROKEN
- Loading branch information
Showing
6 changed files
with
255 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
var offset, timer, pre, scrolling = true; | ||
|
||
// Check every 200msec for fresh data | ||
var interval = 200; | ||
|
||
// Function that asks the API for new data | ||
function reloadData(){ | ||
clearTimeout(timer); | ||
$.getJSON("api.php?tailLog="+offset, function (data) | ||
{ | ||
offset = data["offset"]; | ||
pre.append(data["lines"]); | ||
}); | ||
|
||
if(scrolling) | ||
{ | ||
window.scrollTo(0,document.body.scrollHeight); | ||
} | ||
timer = setTimeout(reloadData, interval); | ||
} | ||
|
||
$(function(){ | ||
// Get offset at first loading of page | ||
$.getJSON("api.php?tailLog", function (data) | ||
{ | ||
offset = data["offset"]; | ||
}); | ||
pre = $("#output"); | ||
// Trigger function that looks for new data | ||
reloadData(); | ||
}); | ||
|
||
$("#chk1").click(function() { | ||
$("#chk2").prop("checked",this.checked); | ||
scrolling = this.checked; | ||
}); | ||
$("#chk2").click(function() { | ||
$("#chk1").prop("checked",this.checked); | ||
scrolling = this.checked; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
require "header.php"; | ||
?> | ||
<!-- Title --> | ||
<div class="page-header"> | ||
<h1>Output the last lines of the pihole.log file (live)</h1> | ||
</div> | ||
|
||
<div class="checkbox"><label><input type="checkbox" name="active" checked id="chk1"> Automatic scrolling on update</label></div> | ||
<pre id="output" style="width: 100%; height: 100%;"></pre> | ||
<div class="checkbox"><label><input type="checkbox" name="active" checked id="chk2"> Automatic scrolling on update</label></div> | ||
|
||
<?php | ||
require "footer.php"; | ||
?> | ||
|
||
|
||
<script src="js/pihole/taillog.js"></script> |