Use all the new Pi-hole v5.0 blocking status code also in the long-term data where it was forgotten to add them.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-06-02 10:03:32 +02:00
parent 814eca9a0f
commit e7eec95ba4
2 changed files with 8 additions and 8 deletions

View File

@@ -269,7 +269,7 @@ if (isset($_GET['topAds']) && $auth)
{
$limit = " AND timestamp <= :until";
}
$stmt = $db->prepare('SELECT domain,count(domain) FROM queries WHERE (STATUS == 1 OR STATUS == 4)'.$limit.' GROUP by domain order by count(domain) desc limit 10');
$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->bindValue(":from", intval($_GET['from']), SQLITE3_INTEGER);
$stmt->bindValue(":until", intval($_GET['until']), SQLITE3_INTEGER);
$results = $stmt->execute();
@@ -401,7 +401,7 @@ if (isset($_GET['getGraphData']) && $auth)
$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 == 4 OR status == 5)'.$limit.' GROUP by interval ORDER by interval');
$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->bindValue(":from", $from, SQLITE3_INTEGER);
$stmt->bindValue(":until", $until, SQLITE3_INTEGER);
$stmt->bindValue(":interval", $interval, SQLITE3_INTEGER);

View File

@@ -198,13 +198,13 @@ var reloadCallback = function () {
statistics = [0, 0, 0, 0];
var data = tableApi.rows().data();
for (var i = 0; i < data.length; i++) {
statistics[0]++;
if (data[i][4] === 1) {
statistics[2]++;
statistics[0]++; // TOTAL query
if (data[i][4] === 1 || (data[i][4] > 4 && data[i][4] !== 10)) {
statistics[2]++; // EXACT blocked
} else if (data[i][4] === 3) {
statistics[1]++;
} else if (data[i][4] === 4) {
statistics[3]++;
statistics[1]++; // CACHE query
} else if (data[i][4] === 4 || data[i][4] === 10) {
statistics[3]++; // REGEX blocked
}
}