From cf53653cfaf581bf6e66aa72cb340309c23195db Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Mon, 3 Jun 2019 15:41:45 +0300 Subject: [PATCH 1/4] + client: split settings page into several pages --- client/src/__locales/en.json | 4 + client/src/components/App/index.js | 36 ++- client/src/components/Header/Header.css | 12 +- client/src/components/Header/Menu.js | 66 ++++- .../Settings/Clients/ClientsTable.js | 260 +++++++++++++++++ .../src/components/Settings/Clients/index.js | 267 +++--------------- client/src/components/Settings/Dhcp/index.js | 205 +++++++------- .../Settings/{ => Dns}/Upstream/Examples.js | 51 +++- .../Settings/{ => Dns}/Upstream/Form.js | 25 +- .../Settings/{ => Dns}/Upstream/index.js | 8 +- client/src/components/Settings/Dns/index.js | 35 +++ .../components/Settings/Encryption/Form.js | 84 +++--- .../components/Settings/Encryption/index.js | 16 +- client/src/components/Settings/index.js | 70 +---- client/src/components/ui/Dropdown.css | 8 + client/src/components/ui/Dropdown.js | 89 ++++++ client/src/components/ui/Icons.js | 24 ++ client/src/containers/Clients.js | 26 ++ client/src/containers/Dhcp.js | 38 +++ client/src/containers/Dns.js | 24 ++ client/src/containers/Encryption.js | 24 ++ client/src/helpers/constants.js | 2 + 22 files changed, 882 insertions(+), 492 deletions(-) create mode 100644 client/src/components/Settings/Clients/ClientsTable.js rename client/src/components/Settings/{ => Dns}/Upstream/Examples.js (55%) rename client/src/components/Settings/{ => Dns}/Upstream/Form.js (88%) rename client/src/components/Settings/{ => Dns}/Upstream/index.js (93%) create mode 100644 client/src/components/Settings/Dns/index.js create mode 100644 client/src/components/ui/Dropdown.css create mode 100644 client/src/components/ui/Dropdown.js create mode 100644 client/src/containers/Clients.js create mode 100644 client/src/containers/Dhcp.js create mode 100644 client/src/containers/Dns.js create mode 100644 client/src/containers/Encryption.js diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index d53593c5..66f3efab 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -96,6 +96,10 @@ "no_servers_specified": "No servers specified", "no_settings": "No settings", "general_settings": "General settings", + "dns_settings": "DNS settings", + "encryption_settings": "Encryption settings", + "dhcp_settings": "DHCP settings", + "clients_settings": "Clients settings", "upstream_dns": "Upstream DNS servers", "upstream_dns_hint": "If you keep this field empty, AdGuard Home will use Cloudflare DNS<\/a> as an upstream.", "test_upstream_btn": "Test upstreams", diff --git a/client/src/components/App/index.js b/client/src/components/App/index.js index 6e5ed768..f77097a0 100644 --- a/client/src/components/App/index.js +++ b/client/src/components/App/index.js @@ -13,6 +13,12 @@ import Header from '../../containers/Header'; import Dashboard from '../../containers/Dashboard'; import Settings from '../../containers/Settings'; import Filters from '../../containers/Filters'; + +import Dns from '../../containers/Dns'; +import Encryption from '../../containers/Encryption'; +import Dhcp from '../../containers/Dhcp'; +import Clients from '../../containers/Clients'; + import Logs from '../../containers/Logs'; import SetupGuide from '../../containers/SetupGuide'; import Toasts from '../Toasts'; @@ -41,7 +47,7 @@ class App extends Component { handleUpdate = () => { this.props.getUpdate(); - } + }; setLanguage = () => { const { processing, language } = this.props.dashboard; @@ -55,19 +61,17 @@ class App extends Component { i18n.on('languageChanged', (lang) => { this.props.changeLanguage(lang); }); - } + }; render() { const { dashboard, encryption } = this.props; const updateAvailable = - !dashboard.processingVersions && - dashboard.isCoreRunning && - dashboard.isUpdateAvailable; + !dashboard.processingVersions && dashboard.isCoreRunning && dashboard.isUpdateAvailable; return ( - + - {updateAvailable && + {updateAvailable && ( - } - {!encryption.processing && + )} + {!encryption.processing && ( - } + )}
- {!dashboard.processing && !dashboard.isCoreRunning && + {!dashboard.processing && !dashboard.isCoreRunning && (
- } - {!dashboard.processing && dashboard.isCoreRunning && + )} + {!dashboard.processing && dashboard.isCoreRunning && ( + + + + - } + )}