Commit Graph

34 Commits

Author SHA1 Message Date
DL6ER
48f7de4cf0 Reposition parseDBData() to simplify diff output
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-12 21:05:56 -04:00
DL6ER
1fa2e07642 Simplify getGraphData and round and to match the requested .
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-12 21:05:56 -04:00
DL6ER
429aa066e7 Fix (almost) endless loop when there are no (or no blocked) queries in the selected interval.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-12 21:05:55 -04:00
DL6ER
f1193a43df Always show the full requested range. Fill data with zero at the end when the daterange is extending into the future. Similarly, fill data wil zero at the beginning if the requested range extends into a region without recorded queries.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-09-12 21:05:54 -04:00
DL6ER
3305982c32 Merge branch 'devel' into new/network-details 2018-12-29 20:21:32 +01:00
DL6ER
9291e8fe50 Simplify API code
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-28 12:18:08 +01:00
DL6ER
cb552159ac Add new "network" API endpoint to database API
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-12-27 09:44:43 +01:00
Mcat12
47d71f4708 Change spaces to tabs in bugfix
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-07 17:06:02 -05:00
Mcat12
127d46d1f9 Fix query types in long term query log being incorrect
Besides A and AAAA, the other query types would show up as AAAA instead
of their actual name.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-07 16:59:38 -05:00
DL6ER
d2ecf1c70a Use comma-separated list of type integers instead of byte-coded integer.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-30 15:02:33 +02:00
DL6ER
3169b5ba88 Add selection for query types on long term DB query log page
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-08-24 14:09:08 +02:00
Mcat12
34f89a83e7 Fill in empty db graph data intervals with zero
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-07-22 12:26:45 -04:00
DL6ER
322b87befe Imporve resolveHostname() subroutine
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-05 16:48:05 +01:00
DL6ER
57f0642c0f Remove unused array
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-05 15:46:23 +01:00
DL6ER
746ac1ea3f Prevent confusion between arrays
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-05 15:45:22 +01:00
DL6ER
f132122e57 Use better client host name caching for DB queries
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-03-05 09:21:11 +01:00
DL6ER
3769069a0a Obtain host names for IP addresses in database. This can also handle cases where we have mixed host names and IP addresses in the result (Pi-hole v3.3+ stores IP addresses in the database, for consistency)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-02-17 20:05:33 +01:00
Mcat12
3f4421da4b Use intval() and SQLITE3_INTEGER in api_db.php
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-20 10:58:41 -05:00
Mcat12
f89cbee1aa Fix SQL injections
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-19 17:40:04 -05:00
DL6ER
60814298ef Total queries should be (all of them) not only (forwarded + cached)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-07 20:46:15 +01:00
DL6ER
0fdebd070c Set maximum execution time to 10 minutes in api_db.php
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-07 20:22:38 +01:00
DL6ER
0fbd860827 Process all returned data before sorting and slicing the data
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-07 19:13:58 +01:00
DL6ER
84012074de Add the same logic for topDomains
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-07 18:15:08 +01:00
DL6ER
9cc8062c88 Fetch up to 20 clients and limit the list to 10 results in PHP
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-07 18:07:39 +01:00
DL6ER
047329a4ae Reset the SQL syntax - directly doing it in PHP is obviously much faster!
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-07 18:02:13 +01:00
DL6ER
f0f32e82a5 Convert all client host names to lower case when requesting api_db.php?topClients
Signed-off-by: DL6ER <dl6er@dl6er.de>
2018-01-07 17:49:55 +01:00
DL6ER
78a8aa8b31 Check if $results is boolean and use fetchArray() only if it isn't
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-12-30 23:44:01 +01:00
DL6ER
ed398fa56f Use possible non-standard location of FTL's database
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-12-16 11:10:10 +01:00
DL6ER
d448a6d6d0 Use SQLITE3_OPEN_READONLY rather than SQLITE3_OPEN_READWRITE
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-08-01 21:03:12 +02:00
DL6ER
09882ae014 Don't create our own class
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-08-01 21:02:08 +02:00
DL6ER
c3e53c8b2d Ensure that it only tries to read the file but doesn't create a new one if it cannot be found.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-08-01 20:58:28 +02:00
DL6ER
a2b1864e8d Try to reconnect to database if first attempt failed
Signed-off-by: DL6ER <dl6er@dl6er.de>
2017-07-20 20:13:05 +02:00
DL6ER
40ae7fb0ca Add long-term graph page (#542)
* Add api_db.php?getGraphData

Signed-off-by: DL6ER <dl6er@dl6er.de>

* Add new DB Graph page

Signed-off-by: DL6ER <dl6er@dl6er.de>

* Adjust x-axis format

Signed-off-by: DL6ER <dl6er@dl6er.de>

* Tweaks to long term stats (#543)

* add maxDate to Datepicker

* remove `GO` Button from datepicker input, instead hook into the apply event to update the graphs/charts when the date range is selected

* :codacy:

Signed-off-by: DL6ER <dl6er@dl6er.de>

* Fix comment + another :codacy:

* Remove duplicated code

* Add click callback to DB graph that sends the user to the DB query log page. This required some re-write of the DB queries page.

* Remove uneeded global variable

* Remove minDate and MaxDate as it is causing issues on fresh installs

* Oh :codacy: ...
2017-07-08 23:42:21 +02:00
DL6ER
9f7fb18f31 Long-term statistics implementation (using FTL's database) (#521)
* - Add DB Top Lists
- Add DB Query Log
- Add DB API

* Allow to select only queries that are equal/newer than the oldest entry in the database
2017-06-29 20:57:09 +02:00