Commit Graph
905 Commits
Author SHA1 Message Date
Mcat12 cf4affc230 Fix description in license of API service tests
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-04-09 20:06:12 -07:00
Mcat12 13722eaf9c Add tests for Result classes
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-04-09 20:05:51 -07:00
Mark Drobnak e80e4282c6 Merge pull request #172 from pi-hole/tweak/list-hostname-validation
Allow the lists to have hostnames instead of just domains
2019-03-29 12:25:05 -04:00
Mcat12 0144a6cce1 Note that hostnames can be added to lists
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-28 20:01:31 -07:00
Mcat12 97a34ba9c9 Allow the lists to have hostnames instead of just domains
See pi-hole/api#124

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-27 21:31:03 -07:00
Mark Drobnak 14d8f9c382 Merge pull request #171 from pi-hole/fix/double-authenticate
Fix sending the authentication request twice on the login screen
2019-03-27 20:24:02 -04:00
Mcat12 15b30bd3d2 Fix sending the authentication request twice on the login screen
If you click "Enter" on your keyboard, it will fire off a form submitted
event which will run the authentication code. However, it will run the
authentication again with a possibly password due to the key down event
handler. This event handler is no longer needed because we have the form
submit handler.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-26 22:46:41 -07:00
Mark Drobnak e5549915e7 Merge pull request #169 from pi-hole/fix/mobile-long-term-stats
Add time range selector to dashboard when in mobile view
2019-03-23 19:55:56 -04:00
Mcat12 0135c90912 Add time range selector to dashboard when in mobile view
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-22 19:25:49 -07:00
Mark Drobnak da88961501 Merge pull request #163 from pi-hole/fix/long-term-fake-data
Add fake data for long term stats
2019-03-21 21:58:56 -04:00
Mark Drobnak 2dec6599b0 Merge branch 'development' into fix/long-term-fake-data 2019-03-21 21:57:47 -04:00
pralor 0e4ae1d764 New Crowdin translations (#162)
Signed-off-by: Mark Drobnak <mark.drobnak@gmail.com>
2019-03-21 21:47:06 -04:00
Mcat12 dc39724aaf Add fake data for long term stats
The fake data suite has been expanded to cover the long term stats
endpoints.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-18 20:02:22 -07:00
Mark Drobnak 6fd2f61189 Merge pull request #161 from pi-hole/fix/query-log-debounce
Load new pages in the Query Log faster
2019-03-18 21:00:51 -04:00
Mark Drobnak f2017f80eb Merge branch 'development' into fix/query-log-debounce 2019-03-18 20:51:26 -04:00
Mark Drobnak 8f26379b9c Merge pull request #160 from pi-hole/feature/dashboard-database-stats
Long Term Data Support in the Dashboard
2019-03-18 20:51:16 -04:00
Mcat12 b7c71ec304 Load new pages in the Query Log faster
Previously each time data needed to be fetched for the query log, it was
debounced for 350ms. This includes fetching new pages when the user
clicks "Next", which causes unnecessary slowdowns. The actual time it
takes to fetch a new page is usually around 20ms, but when it's
debounced it takes 370ms.

The logic is that if the filters have not changed, then don't debounce
the call. The debounce mechanism is only there to prevent multiple calls
when the filters are in flux (user is typing in the search box).

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 20:37:46 -07:00
Mcat12 5b7438eb98 Use a loading indicator in the range name of the graphs when loading
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 19:09:37 -07:00
Mcat12 d8fd902fc0 Show loading state on dashboard when fetching different time range
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 19:03:53 -07:00
Mcat12 740405a08c Only show the long term stats selector when logged in
The API does not allow long term stats lookups when not logged in.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:45:15 -07:00
Mcat12 f9fcb65e3b Add long term stats support to the top clients table
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:45:12 -07:00
Mcat12 3c22ec87cb Add long term stats support to the top blocked domains table
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:45:09 -07:00
Mcat12 eeb9aa9165 Add long term stats support to the top domains table
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:45:06 -07:00
Mcat12 efa07d3f81 Add long term stats support to the upstreams chart
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:45:03 -07:00
Mcat12 10a331e254 Add long term stats support to the query types chart
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:45:01 -07:00
Mcat12 f71367e2a0 Add long term stats support to the clients graph
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:44:58 -07:00
Mcat12 0e56c12c31 Add long term stats support to the queries graph
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:44:55 -07:00
Mcat12 b56f7fe64d Fix dateRanges to only calculate dates once
This fixes preconfigured dates showing up as custom.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:44:51 -07:00
Mcat12 6c20227957 Use TimeRangeSelector in the Query Log
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:44:48 -07:00
Mcat12 66afbae21d Add support for not showing the label in TimeRangeSelector
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:44:45 -07:00
Mcat12 4142d98ff3 Localize dateRanges and move to separate file
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:44:42 -07:00
Mcat12 b88df8d10d Add time range selector to dashboard and integrate summary stats
The time range selector shows the currently selected time range (uses
the label for predefined ranges).

The summary stats will change to using the database call when the
time range is not "Last 24 Hours". Also, when using the database call it
will only make the call once instead of updating periodically.

The date ranges were taken from the Query Log, so it has also been
updated to default to the last 24 hours. This makes more sense than
using "Today", as it now matches the dashboard's default range.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-17 18:44:08 -07:00
Mcat12 8a2fe4b399 Fix TimeRangeContext not propagating value updates
It needs the provider to re-render to update. This is a good place to
start using React Hooks:
https://reactjs.org/docs/hooks-intro.html

React has been updated to 16.8 so we can use Hooks.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-16 13:09:35 -07:00
Mcat12 154ed626ae Add TimeRangeContext
This will be used by the dashboard to control the time range of stats
to pull from the database.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-12 20:18:43 -07:00
Mcat12 2b092ed3b0 Refactor context code into separate files and add more documentation
If the preferences context fails to load the preferences, it now checks
cache again for the freshest preference data.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-12 19:52:11 -07:00
Mark Drobnak 4157e19cdb Merge pull request #159 from pi-hole/tweak/crowdin-pr-checks
Re-enable builds on Crowdin branches and fix DCO email issue
2019-03-12 21:55:10 -04:00
Mcat12 78452d62fe Re-enable builds on Crowdin branches and fix DCO email issue
Crowdin synchronization has been limited to run once every three hours,
so it is safe to re-enable CI builds. Pralor's GitHub email will be used
for the DCO sign-off, as DCO bot doesn't like the pi-hole.net address.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-12 17:57:28 -07:00
pralor b3b1bb7c1b New Crowdin translations (#146)
* New translations api-errors.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations dashboard.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations login.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Bulgarian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations dashboard.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations footer.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations lists.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations login.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations query-log.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Romanian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations lists.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations footer.json (Slovenian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations lists.json (Slovenian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations dashboard.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations lists.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations login.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations query-log.json (Turkish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Italian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Italian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (Italian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations login.json (Italian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Italian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations query-log.json (Italian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Italian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (Italian)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations dashboard.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations dashboard.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations footer.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations lists.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations login.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations query-log.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations lists.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations query-log.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Greek)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations footer.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations lists.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations dashboard.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations lists.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations login.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations query-log.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (French)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (French)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (French)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations query-log.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (French)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations location.json (French)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations settings.json (Spanish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations api-errors.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations common.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations dashboard.json (Catalan)
Signed-off-by: pralor <pralor-bot@pi-hole.net>

* New translations preferences.json (Swedish)
Signed-off-by: pralor <pralor-bot@pi-hole.net>
2019-03-12 00:01:23 -04:00
Mark Drobnak 98b7716ab8 Merge pull request #156 from pi-hole/tweak/type-tweaks
Tweaks to type usage
2019-03-02 13:35:59 -05:00
Mark Drobnak e2b7c6f19a Merge branch 'development' into tweak/type-tweaks 2019-03-02 13:22:40 -05:00
Mark Drobnak 8eb48e49d7 Merge pull request #157 from pi-hole/feature/cache-web-preferences
Cache the web interface preferences in local storage
2019-03-02 13:22:23 -05:00
Mark Drobnak 2d1029ddd7 Merge branch 'development' into feature/cache-web-preferences 2019-03-02 13:18:38 -05:00
Mark Drobnak fb5dd7689d Merge pull request #158 from pi-hole/tweak/security-update
Update dependencies according to npm audit
2019-03-02 13:18:16 -05:00
Mcat12 320463f728 Update dependencies according to npm audit
Before this PR:
> found 688 vulnerabilities (64 low, 623 moderate, 1 high)

After this PR:
> found 64 low severity vulnerabilities

The remaining vulnerabilities require a create-react-app update, which
is tracked here: facebook/create-react-app#6443

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-01 21:57:34 -08:00
Mcat12 563ac8acc8 Cache the web interface preferences in local storage
As part of this change, updating the language with i18n was moved from
`PreferenceSettings` into a new `LanguageApplier` component. Also, the
alert message translation process in `PreferenceSettings` was
refactored. A new dev dependency, `jest-localstorage-mock`, was added to
help test the preferences cache implementation.

See #155

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-01 21:18:10 -08:00
Mcat12 ce177ba4ca Use optional parameters when possible
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-01 19:42:59 -08:00
Mcat12 10d6570d50 Specify language type when mapping languages in PreferenceSettings
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2019-03-01 19:38:23 -08:00
Mark Drobnak 34af02547a Merge pull request #149 from pi-hole/feature/crowdin-languages-json-support
Update the build system to automatically update languages.json
2019-02-28 16:35:18 -05:00
Mark Drobnak 21b60f71a1 Merge branch 'development' into feature/crowdin-languages-json-support 2019-02-28 16:33:45 -05:00
Mark Drobnak 4afaeafcc7 Merge pull request #152 from pi-hole/tweak/readme-instructions
Add "Real Data" section to readme, and recommend start-fake at first
2019-02-28 16:33:34 -05:00