Files
web/scripts/pi-hole/php/tailLog.php
Adam Warner f204b71707 [Staging] 3.1 (#514)
* Remove double click handler

* ~Today~ Over Last 24 Hours

* Rename Top Advertisers to Top Blocked Domains

* percentage should be a float instead of an integer

* Define $over_time as array. Fixes #501

* Add hover/hit radius for Forward Destinations over Time graph

* Add custom callback for tooltips and disable legend for Forward Destinations over Time graph

* Remove legend, add tooltips and increase hit/hover radius for Query Types over Time graph. Fixes #502

* Don't hide detailed graphs on small screens any longer

*  🌮 is the new :shipit: squirrel

* revise wording on main page

shorter text to fit in one line on smaller screens

* Show warning in browser when fopen() failed

* open links in new tab

* open links in new tab

* Update header.php

* select 'Login' in Navbar when showing loginpage

using the same term as it is already used to show up the loginpage (in line 565)

* set the mainbox wider on smaller screens

solves issue of overlapping text with loginbutton when using smaller screens

* also fix overlapping loginpage on footerbar

* remove border on logo

* add link feedback (on hover)

* sessiontimer in bold letters

* use AdminLTE function to toggle dropdown-menu

AdminLTE has already an implemented function to toggle the user menu.
So there is no need to use an own script in footer.js
 
Benefit: The dropdown-menu closes if you click on a blank Place

* align donate-url with url in footerbar

* remove function to open user menu

AdminLTE has already an implemented function to toggle the user menu.
So there is no need to use an own script in footer.js

Benefit: The dropdown-menu closes if you click on a blank Place

* Update LICENSE of the project to EUPL v1.2

* Major overhaul of update checker - checks only every 30 minutes to reduce number of GitHub API requests

* Add version info to dropdown menu (top right) for viewing on small screens. Addresses #333 partially

* Fix typo

* footer.php: improve and clean up

move animation-stylesheet to pi-hole.css (Have you noticed that there is even a text- and text-shadow animation set, but for webkit-browsers only)
added <!-- Version Infos -->
correct continuous hide of version info (AdminLTEs classed widths as `xs` > `sm` > `md` > `lg`)
display Donate-text alwas in one line (do not wrap in between when version info string gets very long)

* pi-hole.css: pasted animation stylesheet

and improved the text-shadow-animation to work correctly with and without -webkit-prefix
(for me this wasn't working until now)

* header.php: some corrections & improvements

pull dropdown-menu always to right side
changed <!-- Update alerts --> to <!-- Version Infos --> (just like it is in footer)
hide version infos in dropdown-menu if it gets shown in footer
repaired update-urls, they also should open up in new tab & gets underlined on hover
`background:none` is needed because AdminLTE adds dark bg on hover to links when using it on smallscreen (xs)

* Minor change to make the dashboard's javascript compatible with escaped characters (like apostrophe) in client names

* Add the same for the top domains

* ... and Top Ads

* Minor change to comments

* footer.php: edited as discussed

* header.php: edited as discussed

* Update queryads.js

* Update list.js

* queryads.js: codacy fixes

* list.js: codacy fixes

* list.js: small correction

* queryads.js: small correction

* Be able to interpret status 5

* Sort list entries (black-/whitelist) alphabetically before creating the table

* queryads.js: Update*

* removed double comment and updated code to center and separate the buttons on small screens, like in my last screenshot.

* list.js: update*

updated code to center and separate the buttons on small screens, like in my last screenshot.
2017-06-20 22:17:37 +01:00

49 lines
1.3 KiB
PHP

<?php
/* Pi-hole: A black hole for Internet advertisements
* (c) 2017 Pi-hole, LLC (https://pi-hole.net)
* Network-wide ad blocking via your own hardware.
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
require "password.php";
if(!$auth) die("Not authorized");
// Not using SplFileObject here, since direct
// usage of f-streams will be much faster for
// files as large as the pihole.log
if(isset($_GET["FTL"]))
{
$file = fopen("/var/log/pihole-FTL.log","r");
}
else
{
$file = fopen("/var/log/pihole.log","r");
}
if(!$file)
{
die(json_encode(array("offset" => 0, "lines" => array("Failed to open log file. Check permissions!\n"))));
}
if(isset($_GET["offset"]))
{
$offset = intval($_GET['offset']);
if($offset > 0)
{
// Seeks on the file pointer where we want to continue reading is known
fseek($file, $offset);
$lines = [];
while (!feof($file))
array_push($lines, htmlspecialchars(fgets($file)));
die(json_encode(array("offset" => ftell($file), "lines" => $lines)));
}
}
// Locate the current position of the file read/write pointer
fseek($file, -1, SEEK_END);
// Add one to skip the very last "\n" in the log file
die(json_encode(array("offset" => ftell($file)+1)));
?>