Commit Graph
557 Commits
Author SHA1 Message Date
Mcat12 f2fbccc759 Validate DNS settings, and save them when Apply is clicked
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-13 17:52:35 -05:00
Mcat12 1e672029cb Update translations
This adds some more strings to settings.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-13 17:23:22 -05:00
Mcat12 61b65a5a42 Change the "recommended" servers to "preconfigured" servers
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-13 17:11:44 -05:00
Mcat12 9be5214bed Override the no matches found message for custom upstreams
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-13 17:11:01 -05:00
Mcat12 1847a8d561 Merge new upstream inputs, reorder recommended upstreams
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-13 16:59:52 -05:00
Mcat12 dc3c9f0640 Add recommended servers to the upstream DNS input
This uses a new package: react-bootstrap-typeahead.

You can switch between the custom and recommended input types via a
toggle button.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-13 16:34:13 -05:00
Mcat12 23aefb8207 Merge remote-tracking branch 'origin/development' into feature/save-dns-settings 2018-12-13 14:07:53 -05:00
Mcat12 6d191a1b1a Refactor DNS settings to split out sections into new components
Also decoupled the state a bit from the API output.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-13 14:07:06 -05:00
Mark Drobnak 76e3910075 Merge pull request #114 from pi-hole/tweak/remove-proxy
Remove the proxy option from package.json
2018-12-12 15:19:09 -05:00
Mark Drobnak d6a7c2b12d Merge branch 'development' into tweak/remove-proxy 2018-12-12 15:17:05 -05:00
Mcat12 77548d1181 Remove the proxy option from package.json
It should only be added when testing against a real API instance. Most
of the time, development is done against the fake API, or there is no
real API running to test with.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-12 15:14:43 -05:00
Mcat12 ef860c5763 Prevent the page from reloading when submitting the DNS form
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-12 15:10:48 -05:00
Mcat12 c451232c9e Fix checkbox input margin
Now the checkboxes line up with the labels.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-12-11 20:52:19 -05:00
Mark Drobnak 9f08cb0725 Merge pull request #112 from pi-hole/tweak/simplify-domainlist
Simplify DomainList
2018-12-10 16:51:18 -05:00
Mcat12 8b520914b0 Fix listening type fake data
"lan" should be "local"

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-30 17:38:38 -05:00
Mcat12 cc9220509f Make the DNS settings editable
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-30 17:37:45 -05:00
Mcat12 b0a377f80c Implement DnsList components
These components will display an editable list of upstream DNS servers.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-30 17:36:45 -05:00
Mcat12 29394ceff9 Fix custom style not applying
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-29 23:24:45 -05:00
Mcat12 237bce2cb2 Simplify DomainList from a class to a function
It should be easier to read now.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-29 18:36:24 -05:00
Mcat12 8f84a66dbc Add isValidIpv4OptionalPort validation function
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-29 17:13:53 -05:00
Mark Drobnak 872eb67ad1 Merge pull request #110 from pi-hole/fix/dhcp-save-unmount
Cancel DHCP update if component unmounts
2018-11-11 14:54:52 -05:00
Mark Drobnak f82effc1e0 Merge branch 'development' into fix/dhcp-save-unmount 2018-11-11 14:53:23 -05:00
Mark Drobnak f1c6bb9a26 Merge pull request #109 from pi-hole/tweak/simplify-list-page
Simplify ListPage and DomainList
2018-11-11 10:09:54 -05:00
Mcat12 2a265d7342 Merge branch 'development' into tweak/simplify-list-page
# Conflicts:
#	src/components/list/DomainList.js
2018-11-11 10:03:26 -05:00
Mark Drobnak 293e537c40 Merge pull request #108 from pi-hole/feature/with-api-component
Abstract Retrieving Data From API
2018-11-11 10:02:18 -05:00
Mcat12 8e77dfb05f Cancel DHCP update if component unmounts
This was done for loading settings, but was forgotten for saving them.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 21:48:19 -05:00
Mcat12 7eeb6cc386 Fix invalid use of error props in summary stats tests
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 21:30:56 -05:00
Mcat12 cfc3b57c98 Move the API tests closer to the API file
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 21:30:16 -05:00
Mcat12 5dfb837b2c Convert VersionInfo to use WithAPIData
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 21:25:52 -05:00
Mcat12 b8ff1adfd1 Convert FTLInfo to use WithAPIData
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 21:16:44 -05:00
Mcat12 d639cfe3d4 Change initialData from a function to object
It was just returning a static object.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 21:16:12 -05:00
Mcat12 3586546580 Convert NetworkInfo to use WithAPIData
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 21:04:17 -05:00
Mcat12 e32e10fccc Fix wrong name in default props for WithAPIData
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 21:03:52 -05:00
Mcat12 f815f5ba55 Simplify ListPage and DomainList
The removal of domains happens in ListPage now instead of DomainList.
The three alerts in ListPage are condensed into one.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 20:44:40 -05:00
Mcat12 efdf602711 Convert StatusBadge to use WithAPIData
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 15:31:49 -05:00
Mcat12 f6cd2d3c57 Convert "TopX" components to use WithAPIData
Also improved the testability of the components.
Fixed an issue in WithAPIData where the component would get undefined
data if the promise was canceled.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 15:23:47 -05:00
Mcat12 a52efd0c3d Convert QueriesGraph to use WithAPIData
Also fix ClientsGraph's options, because they required the translate
function and couldn't be static.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 14:12:00 -05:00
Mcat12 de99025f49 Convert GenericDoughnutChart to use WithAPIData
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 11:33:58 -05:00
Mcat12 15813e2124 Rename ClientsGraph loadingState to loadingProps
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 11:23:02 -05:00
Mcat12 f070ffe208 Merge branch 'development' into feature/with-api-component 2018-11-10 11:15:35 -05:00
Mcat12 a87ed892cd Convert ClientsGraph to use WithAPIData
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 11:10:42 -05:00
Mcat12 131a418cb7 Add test for summary API data transformation function
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-10 10:53:38 -05:00
Mark Drobnak 10eb316898 Merge pull request #106 from pi-hole/feature/update-dhcp
Save DHCP Settings
2018-11-10 10:12:37 -05:00
Mcat12 2b8feb0808 Remove fetchMock from SummaryStats tests
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-09 23:58:34 -05:00
Mcat12 309bcabf9b Add WithAPIData component
This component acts as a provider of API data to decouple the view
from the data source. Previously the components would handle getting
the API data themselves, which hurt testing.

util.js has been split out into three files in a new "util" directory.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-09 23:49:47 -05:00
Mcat12 8fd794a905 Add DHCPInfo tests
Also renamed `updateDHCPInfo` to `loadDHCPInfo` to note that it does not
save/update the DHCP info.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-09 18:14:03 -05:00
Mcat12 ec26ad763b Fix isCanceled test issue
When the convertJSON call was added as a catch to the api call
response promises, it didn't handle canceled requests correctly.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-08 23:21:13 -05:00
Mcat12 ef39aff53d Update translations for new settings strings
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-08 23:04:53 -05:00
Mcat12 eadde4ddc5 Show progress and result of saving DHCP settings
The submit button is disabled while the settings are being processed.

Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-08 22:53:59 -05:00
Mcat12 6177dcc9ae Add default argument for onClick in Alert
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
2018-11-08 22:50:47 -05:00