+ client: show confirm before setting static IP
This commit is contained in:
parent
7afa16fbe7
commit
f61d5f0f85
|
@ -468,5 +468,6 @@
|
||||||
"set_static_ip": "Set a static IP address",
|
"set_static_ip": "Set a static IP address",
|
||||||
"install_static_ok": "Good news! The static IP address is already configured",
|
"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_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?"
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,7 @@ class Settings extends Component {
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="btn btn-outline-primary btn-sm"
|
className="btn btn-outline-primary btn-sm"
|
||||||
onClick={this.handleStaticIp}
|
onClick={() => this.handleStaticIp(ip)}
|
||||||
>
|
>
|
||||||
<Trans>set_static_ip</Trans>
|
<Trans>set_static_ip</Trans>
|
||||||
</button>
|
</button>
|
||||||
|
@ -133,7 +133,7 @@ class Settings extends Component {
|
||||||
handleFix(web, dns, set_static_ip);
|
handleFix(web, dns, set_static_ip);
|
||||||
};
|
};
|
||||||
|
|
||||||
handleStaticIp = () => {
|
handleStaticIp = (ip) => {
|
||||||
const {
|
const {
|
||||||
webIp,
|
webIp,
|
||||||
webPort,
|
webPort,
|
||||||
|
@ -146,7 +146,9 @@ class Settings extends Component {
|
||||||
const dns = { ip: dnsIp, port: dnsPort, autofix: false };
|
const dns = { ip: dnsIp, port: dnsPort, autofix: false };
|
||||||
const set_static_ip = true;
|
const set_static_ip = true;
|
||||||
|
|
||||||
|
if (window.confirm(this.props.t('confirm_static_ip', { ip }))) {
|
||||||
handleFix(web, dns, set_static_ip);
|
handleFix(web, dns, set_static_ip);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Loading…
Reference in New Issue