Merge branch 'devel' into mobile-query-log2

This commit is contained in:
Mark Drobnak
2017-12-22 12:44:30 -05:00
committed by GitHub
9 changed files with 48 additions and 27 deletions
+1
View File
@@ -132,6 +132,7 @@ if(strlen($showing) > 0)
</tr>
</tfoot>
</table>
<label><input type="checkbox" id="autofilter" checked="true">&nbsp;Apply filtering on click on Type, Domain, and Clients</label><br/>
<button type="button" id="resetButton" hidden="true">Clear Filters</button>
</div>
<!-- /.box-body -->
+1 -1
View File
@@ -182,7 +182,7 @@ $(document).ready(function() {
title: function(tooltipItem, data) {
var label = tooltipItem[0].xLabel;
var time = new Date(label);
var date = time.getFullYear()+"-"+padNumber(time.getMonth())+"-"+padNumber(time.getDate());
var date = time.getFullYear()+"-"+padNumber(time.getMonth()+1)+"-"+padNumber(time.getDate());
var h = time.getHours();
var m = time.getMinutes();
var from = padNumber(h)+":"+padNumber(m)+":00";
+1 -1
View File
@@ -141,7 +141,7 @@ function add(arg) {
$.ajax({
url: "scripts/pi-hole/php/add.php",
method: "post",
data: {"domain":domain.val(), "list":locallistType, "token":token},
data: {"domain":domain.val().trim(), "list":locallistType, "token":token},
success: function(response) {
if (response.indexOf("] Pi-hole blocking is ") === -1) {
alFailure.show();
+12 -8
View File
@@ -3,7 +3,7 @@
* 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. */
* Please see LICENSE file for your rights under this license. */
var tableApi;
function escapeRegex(text) {
@@ -96,6 +96,10 @@ function handleAjaxError( xhr, textStatus, error ) {
tableApi.draw();
}
function autofilter(){
return document.getElementById("autofilter").checked;
}
$(document).ready(function() {
var status;
@@ -189,22 +193,22 @@ $(document).ready(function() {
"initComplete": function () {
var api = this.api();
// Query type IPv4 / IPv6
api.$('td:eq(1)').click( function () { api.search( this.innerHTML ).draw(); $('#resetButton').show(); } );
api.$('td:eq(1)').hover(
api.$("td:eq(1)").click( function () { if(autofilter()){ api.search( this.innerHTML ).draw(); $("#resetButton").show(); }});
api.$("td:eq(1)").hover(
function () { this.title="Click to show only "+this.innerHTML+" queries"; this.style.color="#72afd2" },
function () { this.style.color="" }
);
api.$("td:eq(1)").css("cursor","pointer");
// Domain
api.$('td:eq(2)').click( function () { api.search( this.innerHTML ).draw(); $('#resetButton').show(); } );
api.$('td:eq(2)').hover(
api.$("td:eq(2)").click( function () { if(autofilter()){ api.search( this.innerHTML ).draw(); $("#resetButton").show(); }});
api.$("td:eq(2)").hover(
function () { this.title="Click to show only queries with domain "+this.innerHTML; this.style.color="#72afd2" },
function () { this.style.color="" }
);
api.$("td:eq(2)").css("cursor","pointer");
// Client
api.$('td:eq(3)').click( function () { api.search( this.innerHTML ).draw(); $('#resetButton').show(); } );
api.$('td:eq(3)').hover(
api.$("td:eq(3)").click( function () { if(autofilter()){ api.search( this.innerHTML ).draw(); $("#resetButton").show(); }});
api.$("td:eq(3)").hover(
function () { this.title="Click to show only queries made by "+this.innerHTML; this.style.color="#72afd2" },
function () { this.style.color="" }
);
@@ -224,7 +228,7 @@ $(document).ready(function() {
}
} );
$('#resetButton').click( function () { tableApi.search("").draw(); $('#resetButton').hide(); } );
$("#resetButton").click( function () { tableApi.search("").draw(); $("#resetButton").hide(); } );
} );
+5 -4
View File
@@ -57,9 +57,10 @@ function httpGet(ta,quiet,theUrl)
function eventsource() {
var ta = $("#output");
var domain = $("#domain");
var domain = $("#domain").val().trim();
var q = $("#quiet");
if(domain.val().length === 0)
if(domain.length === 0)
{
return;
}
@@ -73,12 +74,12 @@ function eventsource() {
// IE does not support EventSource - load whole content at once
if (typeof EventSource !== "function") {
httpGet(ta,quiet,"/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val().toLowerCase()+exact+"&IE");
httpGet(ta,quiet,"/admin/scripts/pi-hole/php/queryads.php?domain="+domain.toLowerCase()+exact+"&IE");
return;
}
var host = window.location.host;
var source = new EventSource("/admin/scripts/pi-hole/php/queryads.php?domain="+domain.val().toLowerCase()+"&"+exact);
var source = new EventSource("/admin/scripts/pi-hole/php/queryads.php?domain="+domain.toLowerCase()+"&"+exact);
// Reset and show field
ta.empty();
+2 -1
View File
@@ -48,7 +48,7 @@
<!-- /.content-wrapper -->
<footer class="main-footer">
<!-- Version Infos -->
<div class="pull-right hidden-xs hidden-sm<?php if(isset($core_commit) || isset($web_commit)) { ?> hidden-md<?php } ?>">
<div class="pull-right hidden-xs hidden-sm<?php if(isset($core_commit) || isset($web_commit) || isset($FTL_commit)) { ?> hidden-md<?php } ?>">
<b>Pi-hole Version </b> <?php
echo $core_current;
if(isset($core_commit)) { echo " (".$core_branch.", ".$core_commit.")"; }
@@ -59,6 +59,7 @@
if($web_update){ ?> <a class="alert-link lookatme" href="https://github.com/pi-hole/AdminLTE/releases" target="_blank">(Update available!)</a><?php } ?>
<b>FTL Version </b> <?php
echo $FTL_current;
if(isset($FTL_commit)) { echo " (".$FTL_branch.", ".$FTL_commit.")"; }
if($FTL_update){ ?> <a class="alert-link lookatme" href="https://github.com/pi-hole/FTL/releases" target="_blank">(Update available!)</a><?php } ?>
</div>
<div style="display: inline-block"><strong><a href="https://pi-hole.net/donate" target="_blank"><i class="fa fa-heart"></i> Donate</a></strong> if you found this useful.</div>
+1 -2
View File
@@ -4,9 +4,8 @@
* 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. */ ?>
* Please see LICENSE file for your rights under this license. */
<?php
require "scripts/pi-hole/php/auth.php";
require "scripts/pi-hole/php/password.php";
+18 -3
View File
@@ -42,8 +42,15 @@ else
$web_current = explode("-",$versions[1])[0];
}
/********** Get Pi-hole FTL version (not a git repository) **********/
$FTL_current = $versions[2];
/********** Get Pi-hole FTL (not a git repository) **********/
$FTL_branch = $branches[2];
if($FTL_branch !== "master") {
$FTL_current = "vDev";
$FTL_commit = $versions[2];
}
else {
$FTL_current = explode("-",$versions[2])[0];
}
// Get data from GitHub
$core_latest = $GitHubversions[0];
@@ -77,7 +84,15 @@ else
// FTL version comparison
// This logic allows the local core version to be newer than the upstream version
// The update indicator is only shown if the upstream version is NEWER
$FTL_update = (version_compare($FTL_current, $FTL_latest) < 0);
if($FTL_current !== "vDev")
{
$FTL_update = (version_compare($FTL_current, $FTL_latest) < 0);
}
else
{
$FTL_update = false;
}
}
?>
+7 -7
View File
@@ -10,11 +10,6 @@ require "scripts/pi-hole/php/savesettings.php";
// Reread ini file as things might have been changed
$setupVars = parse_ini_file("/etc/pihole/setupVars.conf");
function command_exist($cmd)
{
return !empty(shell_exec(sprintf("which %s", escapeshellarg($cmd))));
}
?>
<style type="text/css">
.tooltip-inner {
@@ -227,8 +222,8 @@ if (isset($setupVars["API_PRIVACY_MODE"])) {
?>
<?php
if (in_array($_GET['tab'], array("sysadmin", "blocklists", "dns", "piholedhcp", "api", "teleporter"))) {
<?php
if (isset($_GET['tab']) && in_array($_GET['tab'], array("sysadmin", "blocklists", "dns", "piholedhcp", "api", "teleporter"))) {
$tab = $_GET['tab'];
} else {
$tab = "sysadmin";
@@ -1182,6 +1177,11 @@ if (in_array($_GET['tab'], array("sysadmin", "blocklists", "dns", "piholedhcp",
<button type="button" class="btn btn-danger confirm-reboot form-control">Restart system</button>
</div>
</div>
<form role="form" method="post" id="flushlogsform">
<input type="hidden" name="field" value="flushlogs">
<input type="hidden" name="token" value="<?php echo $token ?>">
</form>
<form role="form" method="post" id="disablelogsform">
<input type="hidden" name="field" value="Logging">
<input type="hidden" name="action" value="Disable">