Commit Graph

33 Commits

Author SHA1 Message Date
DL6ER
0d0a8dba67 Change prettier option trailingComma from "none" to the new default "es5" (see https://prettier.io/docs/en/options.html#trailing-commas)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-06-23 11:26:43 +02:00
Dan Schaper
2976254bbc unicorn/no-lonely-if
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-01-02 20:53:20 -08:00
yubiuser
5565d00617 Change timePicker to 24h format in dateragepicker
Signed-off-by: yubiuser <ckoenig@posteo.de>
2020-07-26 12:47:32 +02:00
DL6ER
4bf018b52c Add missing radix information in parseInt().
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-06-04 16:57:55 +02:00
Adam Warner
02a4e83d87 create utils.getGraphType() function.
also apply setting to long term graphs
flip logic - only return "line" if the setting is explicitly set to "false"

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-06-01 21:10:14 +01:00
XhmikosR
cecb5aa88c Use $(fn)
This is the recommended way in jQuery 3.x.

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-05-30 10:24:55 +03:00
XhmikosR
61c29cafc4 Move padNumber() to utils.
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-05-29 11:11:34 +03:00
XhmikosR
7f71f1d5fe Move objectToArray() to utils.
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-05-29 11:11:32 +03:00
DL6ER
fc78d470a8 Merge pull request #1358 from pi-hole/XhmikosR-patch-2
db_graph.js: move variable where it's used
2020-05-25 20:14:08 +02:00
DL6ER
61a3ec1b2b Merge pull request #1298 from pi-hole/XhmikosR-patch-5
Enable `no-zero-fractions` rule
2020-05-25 19:48:01 +02:00
XhmikosR
138e4b6e1a db_graph.js: move variable where it's used
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-05-23 13:14:47 +03:00
XhmikosR
0fa7de82b0 JS: Enforce camelcase.
It's a common convention to use camelcase for variable names.

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-05-23 10:29:44 +03:00
XhmikosR
623087346a Enable no-zero-fractions rule
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-05-17 15:03:52 +03:00
XhmikosR
e02df5467a Fix lint errors.
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-05-11 09:20:32 +03:00
DL6ER
73ee91a024 Merge branch 'master' into master-to-development-v5.0
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-05-10 22:00:07 +02:00
XhmikosR
ae13014565 Adapt to the new rules.
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-04-10 18:34:47 +00:00
Dan Schaper
e319db238a Merge branch 'release/v5.0' into fix/queries_over_time 2020-01-25 17:50:43 -08:00
DL6ER
4337dabff6 Always break tooltip title into two lines on narrow screens.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-01-03 14:56:49 +02:00
DL6ER
f2713a9b3d Always show date (but only once if the interval is on the same date), break long lines on small displays, and abbreviate gray color definition.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-01-03 14:56:13 +02:00
DL6ER
ac1e68acde Apply the same changes to the long-term graph page.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-01-03 14:54:59 +02:00
DL6ER
81d7d24910 Use correct interval for the database query when clicking on one of the long-term graph bars.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-01-03 14:50:48 +02:00
XhmikosR
704c352277 Format JS code
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2020-01-02 19:42:18 +02:00
DL6ER
4f42ebcbca Add interval directly without extending the prototype.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-19 08:54:24 +00:00
DL6ER
aca6461468 Change over-time graphs from line to stacked bar representation. This is much more natural for this kind of data. Also, improve DB graphs to always generate a meaningful display (always generate about 200 bars). This graph was basically unusable when specifying a larger range than, say, one week.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-12-18 13:22:33 +00:00
XhmikosR
9c1846885a Clean up JS
* remove unused variables/functions
* use the dot notation
* use explicit coercion
* remove unneeded else
* use `textContent` instead of `innerHTML`
* cache a few `getElementById` calls
* fix a couple of undefined variables
* various assorted lint tweaks

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2019-12-16 20:36:40 +02:00
XhmikosR
97bc779299 db_graph.js: Fix IE 11
IE doesn't support `Array.includes()`

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2019-12-16 19:29:24 +02:00
XhmikosR
7031d19d25 Remove unneeded escape characters
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2019-12-09 21:50:42 +02:00
Mcat12
2ba8787261 Merge branch 'release/v4.2' into devel
# Conflicts:
#	scripts/pi-hole/js/db_graph.js
2019-02-03 11:24:19 -08:00
DL6ER
a975576616 Long-term data: Show date range only after user chose a valid range. Fixes #897
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-01-22 23:30:36 +01:00
DL6ER
8ae36a0dcb Fill daterange field with initialization (now-6d -> now)
Signed-off-by: DL6ER <dl6er@dl6er.de>
2019-01-20 11:36:39 +01:00
Mcat12
081f0bb98c Add timeout warning to database pages
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-01-07 14:04:38 -05:00
Bryan Tsang
4530e5d89d Fix off-by-one display of month
Signed-off-by: Bryan Tsang <bvtsang@gmail.com>
2017-12-09 01:01:44 -08: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