+ client: show confirm before setting static IP

This commit is contained in:
Ildar Kamalov 2020-02-13 14:13:35 +03:00
parent 7afa16fbe7
commit f61d5f0f85
2 changed files with 7 additions and 4 deletions

View File

@ -468,5 +468,6 @@
"set_static_ip": "Set a static IP address",
"install_static_ok": "Good news! The static IP address is 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}}</0>. Do you want to use it as your static address?"
"install_static_configure": "We have detected that a dynamic IP address is used — <0>{{ip}}</0>. Do you want to use it as your static address?",
"confirm_static_ip": "AdGuard Home will configure {{ip}} to be your static IP address. Do you want to proceed?"
}

View File

@ -89,7 +89,7 @@ class Settings extends Component {
<button
type="button"
className="btn btn-outline-primary btn-sm"
onClick={this.handleStaticIp}
onClick={() => this.handleStaticIp(ip)}
>
<Trans>set_static_ip</Trans>
</button>
@ -133,7 +133,7 @@ class Settings extends Component {
handleFix(web, dns, set_static_ip);
};
handleStaticIp = () => {
handleStaticIp = (ip) => {
const {
webIp,
webPort,
@ -146,7 +146,9 @@ class Settings extends Component {
const dns = { ip: dnsIp, port: dnsPort, autofix: false };
const set_static_ip = true;
handleFix(web, dns, set_static_ip);
if (window.confirm(this.props.t('confirm_static_ip', { ip }))) {
handleFix(web, dns, set_static_ip);
}
};
render() {