mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Modified Taillog to prevent offscreen scrolling.
Signed-off-by: Toakan <tdaykin@live.co.uk>
This commit is contained in:
@@ -14,14 +14,15 @@ function reloadData(){
|
||||
clearTimeout(timer);
|
||||
$.getJSON("scripts/pi-hole/php/tailLog.php?FTL&offset="+offset, function (data)
|
||||
{
|
||||
offset = data["offset"];
|
||||
pre.append(data["lines"]);
|
||||
|
||||
if(scrolling && offset !== data["offset"]) {
|
||||
pre.scrollTop(pre[0].scrollHeight);
|
||||
}
|
||||
|
||||
offset = data["offset"];
|
||||
});
|
||||
|
||||
if(scrolling)
|
||||
{
|
||||
window.scrollTo(0,document.body.scrollHeight);
|
||||
}
|
||||
timer = setTimeout(reloadData, interval);
|
||||
}
|
||||
|
||||
|
||||
@@ -14,14 +14,15 @@ function reloadData(){
|
||||
clearTimeout(timer);
|
||||
$.getJSON("scripts/pi-hole/php/tailLog.php?offset="+offset, function (data)
|
||||
{
|
||||
offset = data["offset"];
|
||||
pre.append(data["lines"]);
|
||||
|
||||
if(scrolling && offset !== data["offset"]) {
|
||||
pre.scrollTop(pre[0].scrollHeight);
|
||||
}
|
||||
|
||||
offset = data["offset"];
|
||||
});
|
||||
|
||||
if(scrolling)
|
||||
{
|
||||
window.scrollTo(0,document.body.scrollHeight);
|
||||
}
|
||||
timer = setTimeout(reloadData, interval);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
</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>
|
||||
<pre id="output" style="width: 100%; height: 100%; max-height:650px; overflow-y:scroll;"></pre>
|
||||
<div class="checkbox"><label><input type="checkbox" name="active" checked id="chk2"> Automatic scrolling on update</label></div>
|
||||
|
||||
<?php
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
</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>
|
||||
<pre id="output" style="width: 100%; height: 100%; max-height:650px; overflow-y:scroll;"></pre>
|
||||
<div class="checkbox"><label><input type="checkbox" name="active" checked id="chk2"> Automatic scrolling on update</label></div>
|
||||
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user