Skip to content

Commit

Permalink
Merge pull request pi-hole#1779 from pi-hole/release/v5.5
Browse files Browse the repository at this point in the history
Pi-hole Web 5.5
  • Loading branch information
PromoFaux authored Apr 14, 2021
2 parents 989e1ba + 937880e commit 7e602e0
Show file tree
Hide file tree
Showing 14 changed files with 6,468 additions and 84 deletions.
7 changes: 4 additions & 3 deletions api_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ function resolveHostname($clientip, $printIP)
{
$limit = " AND timestamp <= :until";
}
$stmt = $db->prepare('SELECT domain,count(domain) FROM queries WHERE (STATUS == 2 OR STATUS == 3)'.$limit.' GROUP by domain order by count(domain) desc limit 20');
// Select top permitted domains only
$stmt = $db->prepare('SELECT domain,count(domain) FROM queries WHERE status IN (2,3,12,13,14)'.$limit.' GROUP by domain order by count(domain) desc limit 20');
$stmt->bindValue(":from", intval($_GET['from']), SQLITE3_INTEGER);
$stmt->bindValue(":until", intval($_GET['until']), SQLITE3_INTEGER);
$results = $stmt->execute();
Expand Down Expand Up @@ -252,7 +253,7 @@ function resolveHostname($clientip, $printIP)
{
$limit = " AND timestamp <= :until";
}
$stmt = $db->prepare('SELECT domain,count(domain) FROM queries WHERE (STATUS == 1 OR STATUS > 3)'.$limit.' GROUP by domain order by count(domain) desc limit 10');
$stmt = $db->prepare('SELECT domain,count(domain) FROM queries WHERE status IN (1,4,5,6,7,8,9,10,11)'.$limit.' GROUP by domain order by count(domain) desc limit 10');
$stmt->bindValue(":from", intval($_GET['from']), SQLITE3_INTEGER);
$stmt->bindValue(":until", intval($_GET['until']), SQLITE3_INTEGER);
$results = $stmt->execute();
Expand Down Expand Up @@ -384,7 +385,7 @@ function parseDBData($results, $interval, $from, $until) {
$data = array_merge($data, $result);

// Count blocked queries in intervals
$stmt = $db->prepare('SELECT (timestamp/:interval)*:interval interval, COUNT(*) FROM queries WHERE (status == 1 OR status > 3)'.$limit.' GROUP by interval ORDER by interval');
$stmt = $db->prepare('SELECT (timestamp/:interval)*:interval interval, COUNT(*) FROM queries WHERE status IN (1,4,5,6,7,8,9,10,11)'.$limit.' GROUP by interval ORDER by interval');
$stmt->bindValue(":from", $from, SQLITE3_INTEGER);
$stmt->bindValue(":until", $until, SQLITE3_INTEGER);
$stmt->bindValue(":interval", $interval, SQLITE3_INTEGER);
Expand Down
2 changes: 2 additions & 0 deletions groups-adlists.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<ol>
<li>Please run <code>pihole -g</code> or update your gravity list <a href="gravity.php">online</a> after modifying your adlists.</li>
<li>Multiple adlists can be added by separating each <i>unique</i> URL with a space</li>
<li>Click on the icon in the first column to get additional information about your lists. The icons correspond to the health of the list.</li>
</ol>
<button type="button" id="btnAdd" class="btn btn-primary pull-right">Add</button>
</div>
Expand All @@ -61,6 +62,7 @@
<thead>
<tr>
<th>ID</th>
<th></th>
<th>Address</th>
<th>Status</th>
<th>Comment</th>
Expand Down
100 changes: 54 additions & 46 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"test": "npm run prettier:check && npm run xo"
},
"devDependencies": {
"autoprefixer": "^10.2.1",
"autoprefixer": "^10.2.5",
"eslint-plugin-compat": "^3.9.0",
"postcss": "^8.2.4",
"postcss": "^8.2.9",
"postcss-cli": "^8.3.1",
"prettier": "2.2.1",
"xo": "^0.37.1"
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/js/db_queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ var reloadCallback = function () {
var data = tableApi.rows().data();
for (var i = 0; i < data.length; i++) {
statistics[0]++; // TOTAL query
if (data[i][4] === 1 || (data[i][4] > 4 && data[i][4] !== 10)) {
if (data[i][4] === 1 || (data[i][4] > 4 && ![10, 12, 13, 14].includes(data[i][4]))) {
statistics[2]++; // EXACT blocked
} else if (data[i][4] === 3) {
statistics[1]++; // CACHE query
Expand Down
Loading

0 comments on commit 7e602e0

Please sign in to comment.