Squashed commit of the following:

- Dynamically fall back to PHP API functions to ensure API does always repond even if FTL is not runnung for some reason
- Update PHP API from current devel branch
- Increase flexibility in getQueryTypes API call
- Hide top ads list if nothing to display
- Proper display of activated privacy mode
- Remove spinner (would otherwise not be removed for zero results)
- Update tables every 10 seconds
- Update query types and forward destinations plots every 10 seconds
- More verbose output in top lists (total number next to percentage in tooltip)
- Implemented "recentBlocked" keyword for API
- Ensure compatibility with PHP5 version < 5.4
- Adjust output format of overTimeData10mins to comply with PHP API
- Further speedup of Query Log page by showing only the recent 10 minutes by default
- Hide temperature if FTL is not running and show FTL status
- Add information to Settings page
- Adjust error message when loading of query log failed
- Move processing of domainname, clientIP, clientname and time interval filters for the Query Log page to FTL for speed enhancement
- Generate link if pi.hole comes up in the Top Domains list
- Remove resolve DNS names option - this is now enabled by default (daemon will only do it once per day instead of PHP-API which did it on every reloading of the web interface)
- Add socket timeout of 10 seconds + modification to Settings page since FTL backend supports API_EXCLUDE_CLIENTS filtering with both IP addresses and host names (also mixed)
- Improved Query Log page
This commit is contained in:
DL6ER
2017-02-16 08:52:30 +01:00
parent 5b48803f90
commit aabff35bef
14 changed files with 1214 additions and 268 deletions
+34 -35
View File
@@ -625,24 +625,6 @@
$privacyMode = false;
}
if(istrue($setupVars["API_GET_UPSTREAM_DNS_HOSTNAME"]))
{
$resolveForward = true;
}
else
{
$resolveForward = false;
}
if(istrue($setupVars["API_GET_CLIENT_HOSTNAME"]))
{
$resolveClients = true;
}
else
{
$resolveClients = false;
}
?>
<div class="box box-success">
<div class="box-header with-border">
@@ -661,36 +643,24 @@
<div class="col-lg-6">
<div class="form-group">
<label>Top Clients</label>
<textarea name="clients" class="form-control" rows="4" placeholder="Enter one IP address per line"><?php foreach ($excludedClients as $client) { echo $client."\n"; } ?></textarea>
<textarea name="clients" class="form-control" rows="4" placeholder="Enter one IP address or host name per line"><?php foreach ($excludedClients as $client) { echo $client."\n"; } ?></textarea>
</div>
</div>
<h4>Reverse DNS lookup</h4>
<p>Try to determine the domain name via querying the Pi-hole for</p>
<h4>Privacy settings (Statistics / Query Log)</h4>
<div class="col-lg-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="resolve-forward" <?php if($resolveForward){ ?>checked<?php } ?>> Forward Destinations</label></div>
<div class="checkbox"><label><input type="checkbox" name="querylog-permitted" <?php if($queryLog === "permittedonly" || $queryLog === "all"){ ?>checked<?php } ?>> Show permitted domain entries</label></div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="resolve-clients" <?php if($resolveClients){ ?>checked<?php } ?>> Top Clients</label></div>
</div>
</div>
<h4>Query Log</h4>
<div class="col-lg-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="querylog-permitted" <?php if($queryLog === "permittedonly" || $queryLog === "all"){ ?>checked<?php } ?>> Show permitted queries</label></div>
</div>
</div>
<div class="col-lg-6">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="querylog-blocked" <?php if($queryLog === "blockedonly" || $queryLog === "all"){ ?>checked<?php } ?>> Show blocked queries</label></div>
<div class="checkbox"><label><input type="checkbox" name="querylog-blocked" <?php if($queryLog === "blockedonly" || $queryLog === "all"){ ?>checked<?php } ?>> Show blocked domain entries</label></div>
</div>
</div>
<h4>Privacy mode</h4>
<div class="col-lg-12">
<div class="form-group">
<div class="checkbox"><label><input type="checkbox" name="privacyMode" <?php if($privacyMode){ ?>checked<?php } ?>> Don't show query results for permitted requests</label></div>
<div class="checkbox"><label><input type="checkbox" name="privacyMode" <?php if($privacyMode){ ?>checked<?php } ?>> Don't show origin of DNS requests in query log</label></div>
</div>
</div>
</div>
@@ -766,6 +736,35 @@
</div>
</div>
*/ ?>
<?php
if($FTL)
{
$parts = preg_split('/\s+/',trim(exec("ps -p `cat /var/run/pihole-FTL.pid` -o pid,start,vsz,rss,euser,egroup,cputime,%cpu,%mem")));
// pid
// time the command started. If the process was started less than 24 hours ago, the output format is "HH:MM:SS", else it is " Mmm dd" (where Mmm is a three-letter month name).
// virtual memory size of the process in KiB
// resident set size, the non-swapped physical memory that a task has used (inkiloBytes).
// effective user name. This will be the textual user ID, if it can be obtained
// effective group ID of the process. This will be the textual group ID, if it can be obtained
// cumulative CPU time, "[DD-]hh:mm:ss" format. (alias time)
// cpu utilization of the process in "##.#" format. Currently, it is the CPU time used divided by the time the process has been running (cputime/realtime ratio), expressed as a percentage.
// ratio of the process's resident set size to the physical memory on the machine, expressed as a percentage.
}
?>
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">FTL status (<?php if($FTL){ ?>Running, PID: <?php echo $parts[0]; ?><?php }else{ ?>Not running<?php } ?>)</h3>
</div>
<div class="box-body">
<?php if($FTL){ ?>Time FTL started: <?php echo $parts[1]; ?><br>
User / Group: <?php echo $parts[4]; ?> / <?php echo $parts[5]; ?><br>
Total CPU utilization: <?php echo $parts[7]; ?>%<br>
Total CPU time: <?php echo $parts[6]; ?><br>
Memory utilization: <?php echo $parts[8]; ?>%<br>
<span title="Resident memory is the portion of memory occupied by a process that is held in main memory (RAM). The rest of the occupied memory exists in the swap space or file system.">Used memory: <?php echo formatSizeUnits(1e3*$parts[3]); ?></span><br>
<?php } ?>
</div>
</div>
<div class="box box-danger">
<div class="box-header with-border">
<h3 class="box-title">System Administration</h3>