mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Merge pull request #802 from pi-hole/devel
Bring missing v4.0 changes into release branch
This commit is contained in:
+31
-11
@@ -325,13 +325,38 @@ if (isset($_GET['getGraphData']) && $auth)
|
||||
$stmt->bindValue(":interval", $interval, SQLITE3_INTEGER);
|
||||
$results = $stmt->execute();
|
||||
|
||||
$domains = array();
|
||||
// Parse the DB result into graph data, filling in missing sections with zero
|
||||
function parseDBData($results, $interval) {
|
||||
$data = array();
|
||||
$min = null;
|
||||
$max = null;
|
||||
|
||||
if(!is_bool($results))
|
||||
while ($row = $results->fetchArray())
|
||||
{
|
||||
$domains[$row[0]] = intval($row[1]);
|
||||
if(!is_bool($results)) {
|
||||
// Read in the data
|
||||
while($row = $results->fetchArray()) {
|
||||
// Get min and max timestamps
|
||||
if($min === null || $min > $row[0])
|
||||
$min = $row[0];
|
||||
|
||||
if($max === null || $max < $row[0])
|
||||
$max = $row[0];
|
||||
|
||||
// Get the non-zero graph data
|
||||
$data[$row[0]] = intval($row[1]);
|
||||
}
|
||||
|
||||
// Fill the missing intervals with zero
|
||||
for($i = $min; $i < $max; $i += $interval) {
|
||||
if(!array_key_exists($i, $data))
|
||||
$data[$i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
$domains = parseDBData($results, $interval);
|
||||
|
||||
$result = array('domains_over_time' => $domains);
|
||||
$data = array_merge($data, $result);
|
||||
|
||||
@@ -342,13 +367,8 @@ if (isset($_GET['getGraphData']) && $auth)
|
||||
$stmt->bindValue(":interval", $interval, SQLITE3_INTEGER);
|
||||
$results = $stmt->execute();
|
||||
|
||||
$addomains = array();
|
||||
$addomains = parseDBData($results, $interval);
|
||||
|
||||
if(!is_bool($results))
|
||||
while ($row = $results->fetchArray())
|
||||
{
|
||||
$addomains[$row[0]] = intval($row[1]);
|
||||
}
|
||||
$result = array('ads_over_time' => $addomains);
|
||||
$data = array_merge($data, $result);
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@
|
||||
?>
|
||||
<!-- Title -->
|
||||
<div class="page-header">
|
||||
<h1>Update list of ad-serving domains / blacklist / whitelist</h1>
|
||||
<h1>Update Gravity (list of blocked domains)</h1>
|
||||
</div>
|
||||
|
||||
<!-- Alerts -->
|
||||
@@ -22,7 +22,7 @@
|
||||
Success!
|
||||
</div>
|
||||
|
||||
<button class="btn btn-lg btn-primary btn-block" id="gravityBtn">Update Lists</button>
|
||||
<button class="btn btn-lg btn-primary btn-block" id="gravityBtn">Update</button>
|
||||
<pre id="output" style="width: 100%; height: 100%;" hidden="true"></pre>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -82,14 +82,14 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Tools → Update Lists</h2>
|
||||
<p>Will download any updates from the third-party ad-serving domain lists that we source. By default, this command runs once a week via cron (Sunday at 01:59).</p>
|
||||
<h2>Tools → Update Gravity</h2>
|
||||
<p>Will download any updates from the third-party blocklists that we source. By default, this command runs once a week via cron (Sunday).</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h2>Tools → Query adlists</h2>
|
||||
This function is useful to find out what list a domain appears on. Since we don't control what the third-parties put on the block lists, you may find that a domain you normally visit stops working. If this is the case, you could run this command to scan for strings in the list of blocked domains and it will return the list the domain is found on. This proved useful a while back when the Mahakala list was adding <samp>apple.com</samp> and <samp>microsoft.com</samp> to their block list.</p>
|
||||
<h2>Tools → Query Lists</h2>
|
||||
This function is useful to find out what list a domain appears on. Since we don't control what the third-parties put on the blocklists, you may find that a domain you normally visit stops working. If this is the case, you could run this command to scan for strings in the list of blocked domains and it will return the list the domain is found on. This proved useful a while back when the Mahakala list was adding <samp>apple.com</samp> and <samp>microsoft.com</samp> to their block list.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@@ -102,26 +102,20 @@
|
||||
<div class="col-md-12">
|
||||
<h2>Settings</h2>
|
||||
Change settings for the Pi-hole
|
||||
<h4>Networking</h4>
|
||||
Displays information about the interfaces of the Pi-hole. No changes possible.
|
||||
<h4>Pi-hole DHCP Server</h4>
|
||||
Using this setting you can enable/disable the DHCP server of the Pi-hole. Note that you should disable any other DHCP server on your network to avoid IP addresses being used more than once. You have to give the range of IPs that DHCP will serve and the IP of the local router (gateway). If the DHCP server is active, the current leases are shown on the settings page. IPv4 DHCP will always be activated, IPv6 (stateless + statefull) can be enabled.
|
||||
<h4>Upstream DNS Servers</h4>
|
||||
<h4>System</h4>
|
||||
Displays network and other system information of Pi-hole. At the bottom there is a "Danger Zone" with actions such as disable query logging and reboot.
|
||||
<h4>Blocklists</h4>
|
||||
View and edit the blocklists sourced for blocked domains.
|
||||
<h4>DNS</h4>
|
||||
Customize used upstream DNS servers + advanced settings for DNS servers. Note that any number of DNS servers may be enabled at a time.
|
||||
<h4>Query Logging</h4>
|
||||
Enabled/disable query logging on your Pi-hole + provide option to flush the log
|
||||
<h4>API</h4>
|
||||
Change settings which apply to the API as well as the web UI
|
||||
<ul>
|
||||
<li>Show permitted domain entries: Toogle permitted queries in Query Log + Top Domains on Main Page</li>
|
||||
<li>Show blockes domain entries: Toogle blocked queries in Query Log + Top Ads on Main Page</li>
|
||||
<li>Privacy mode: Replace IPs in query log with "hidden"</li>
|
||||
</ul>
|
||||
<h4>Web User Interface</h4>
|
||||
Other settings which affect the webUI but not the API of Pi-hole
|
||||
<h4>System Administration</h4>
|
||||
Apply system-wide actions like restarting of the server
|
||||
</div>
|
||||
<h4>DHCP</h4>
|
||||
Using this setting you can enable/disable the DHCP server of the Pi-hole. Note that you should disable any other DHCP server on your network to avoid IP addresses being used more than once. You have to give the range of IPs that DHCP will serve and the IP of the local router (gateway). If the DHCP server is active, the current leases are shown on the settings page. IPv4 DHCP will always be activated, IPv6 (stateless + statefull) can be enabled.
|
||||
<h4>API / Web Interface</h4>
|
||||
Change settings which apply to the API as well as the web interface
|
||||
<h4>Privacy</h4>
|
||||
Set the privacy level for queries. Note that decreasing the privacy level will not disclose previously hidden query data.
|
||||
<h4>Teleporter</h4>
|
||||
Import and export Pi-hole settings.
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
?>
|
||||
<!-- Title -->
|
||||
<div class="page-header">
|
||||
<h1>Find Ad Domain In Lists</h1>
|
||||
<h1>Find Blocked Domain In Lists</h1>
|
||||
</div>
|
||||
<!-- Domain Input -->
|
||||
<div class="form-group input-group">
|
||||
|
||||
@@ -504,13 +504,13 @@ if($auth) {
|
||||
<!-- Run gravity.sh -->
|
||||
<li<?php if($scriptname === "gravity.php"){ ?> class="active"<?php } ?>>
|
||||
<a href="gravity.php">
|
||||
<i class="fa fa-arrow-circle-down"></i> <span>Update Lists</span>
|
||||
<i class="fa fa-arrow-circle-down"></i> <span>Update Gravity</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- Query adlists -->
|
||||
<!-- Query Lists -->
|
||||
<li<?php if($scriptname === "queryads.php"){ ?> class="active"<?php } ?>>
|
||||
<a href="queryads.php">
|
||||
<i class="fa fa-search"></i> <span>Query adlists</span>
|
||||
<i class="fa fa-search"></i> <span>Query Lists</span>
|
||||
</a>
|
||||
</li>
|
||||
<!-- Audit log -->
|
||||
|
||||
+3
-3
@@ -236,7 +236,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs">
|
||||
<li<?php if($tab === "sysadmin"){ ?> class="active"<?php } ?>><a data-toggle="tab" href="#sysadmin">System</a></li>
|
||||
<li<?php if($tab === "blocklists"){ ?> class="active"<?php } ?>><a data-toggle="tab" href="#blocklists">Block Lists</a></li>
|
||||
<li<?php if($tab === "blocklists"){ ?> class="active"<?php } ?>><a data-toggle="tab" href="#blocklists">Blocklists</a></li>
|
||||
<li<?php if($tab === "dns"){ ?> class="active"<?php } ?>><a data-toggle="tab" href="#dns">DNS</a></li>
|
||||
<li<?php if($tab === "piholedhcp"){ ?> class="active"<?php } ?>><a data-toggle="tab" href="#piholedhcp">DHCP</a></li>
|
||||
<li<?php if($tab === "api"){ ?> class="active"<?php } ?>><a data-toggle="tab" href="#api">API / Web interface</a></li>
|
||||
@@ -251,7 +251,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
|
||||
<div class="col-md-12">
|
||||
<div class="box">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Lists used to generate Pi-hole's Gravity: <?php echo count($adlist); ?></h3>
|
||||
<h3 class="box-title">Blocklists used to generate Pi-hole's Gravity: <?php echo count($adlist); ?></h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="table-responsive">
|
||||
@@ -284,7 +284,7 @@ if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists"
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<textarea name="newuserlists" class="form-control" rows="1" placeholder="Enter one URL per line to add new ad lists"></textarea>
|
||||
<textarea name="newuserlists" class="form-control" rows="1" placeholder="Enter one URL per line to add new blocklists"></textarea>
|
||||
</div>
|
||||
<input type="hidden" name="field" value="adlists">
|
||||
<input type="hidden" name="token" value="<?php echo $token ?>">
|
||||
|
||||
Reference in New Issue
Block a user