From 26c47e59dd63317bdb959cb416e7c1c0bfdf7dc1 Mon Sep 17 00:00:00 2001 From: Ildar Kamalov Date: Fri, 7 Feb 2020 18:08:56 +0300 Subject: [PATCH] - client: fix static ip description --- client/src/__locales/en.json | 7 ++- client/src/install/Setup/Settings.js | 75 ++++++++++++++++------------ 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/client/src/__locales/en.json b/client/src/__locales/en.json index 3d93a7de..88442ac8 100644 --- a/client/src/__locales/en.json +++ b/client/src/__locales/en.json @@ -463,7 +463,10 @@ "client_confirm_unblock": "Are you sure you want to unblock the client \"{{ip}}\"?", "client_blocked": "Client \"{{ip}}\" successfully blocked", "client_unblocked": "Client \"{{ip}}\" successfully unblocked", + "static_ip": "Static IP Address", + "static_ip_desc": "AdGuard Home is a server so it needs a static IP address to function properly. Otherwise, at some point, your router may assign a different IP address to this device.", "set_static_ip": "Set a static IP address", - "install_static_error": "We failed to determine if this network interface is configured by using a static IP address. Please set the static IP address manually.", - "install_static_configure": "We have detected that a dynamic IP address is used — {{ip}}. We suggest you to set this IP address as static." + "install_static_ok": "Good news, Static IP already configured", + "install_static_error": "AdGuard Home cannot configure it automatically for your OS. Please look for an instruction on how to do this manually", + "install_static_configure": "We have detected that a dynamic IP address is used — <0>{{ip}}. Do you want to use your it as a static address?" } diff --git a/client/src/install/Setup/Settings.js b/client/src/install/Setup/Settings.js index 0b3120b2..22685ca5 100644 --- a/client/src/install/Setup/Settings.js +++ b/client/src/install/Setup/Settings.js @@ -7,7 +7,6 @@ import flow from 'lodash/flow'; import Controls from './Controls'; import AddressList from './AddressList'; -import Accordion from '../../components/ui/Accordion'; import { getInterfaceIp } from '../../helpers/helpers'; import { ALL_INTERFACES_IP } from '../../helpers/constants'; @@ -72,44 +71,41 @@ class Settings extends Component { } getStaticIpMessage = (staticIp, handleStaticIp) => { - const { static: status, ip, error } = staticIp; + const { static: status, ip } = staticIp; - if (!status || status === STATIC_STATUS.ENABLED) { + if (!status) { return ''; } return ( -
- + + {status === STATIC_STATUS.DISABLED && ( + + text]}> + install_static_configure + + + + )} + {status === STATIC_STATUS.ERROR && (
- {status === STATIC_STATUS.DISABLED && ( - - - install_static_configure - - - - )} - {status === STATIC_STATUS.ERROR && ( - - install_static_error -
- - {error} - -
-
- )} -
+ install_static_error
-
-
+ )} + {status === STATIC_STATUS.ENABLED && ( +
+ + install_static_ok + +
+ )} + ); }; @@ -208,6 +204,7 @@ class Settings extends Component { +
install_settings_dns @@ -248,7 +245,6 @@ class Settings extends Component { />
- {this.getStaticIpMessage(staticIp, handleStaticIp)}
{dnsStatus && @@ -292,6 +288,19 @@ class Settings extends Component {
+ +
+
+ static_ip +
+ +
+ static_ip_desc +
+ + {this.getStaticIpMessage(staticIp, handleStaticIp)} +
+ );