Fixed initial values and string interpolation

This commit is contained in:
Ildar Kamalov 2019-01-25 19:05:50 +03:00 committed by Eugene Bujak
parent 24be7ce4ed
commit beb94741cf
3 changed files with 17 additions and 19 deletions

View File

@ -163,10 +163,10 @@
"install_settings_title": "Admin Web Interface",
"install_settings_listen": "Listen interface",
"install_settings_port": "Port",
"install_settings_interface_link": "Your AdGuard Home admin web interface is available on {{link}}",
"install_settings_interface_link": "Your AdGuard Home admin web interface is available on <0>{{link}}</0>",
"form_error_port": "Enter valid port value",
"install_settings_dns": "DNS server",
"install_settings_dns_desc": "You will need to configure your devices or router to use the DNS server at {{ip}}",
"install_settings_dns_desc": "You will need to configure your devices or router to use the DNS server at <0>{{ip}}</0>",
"install_auth_title": "Authentication",
"install_auth_desc": "It is highly recommended to configure password authentication to your AdGuard Home admin web interface. Even if it is accessible only in your local network, it is still important to have it protected from unrestricted access.",
"install_auth_username": "Username",

View File

@ -97,21 +97,9 @@ class Dhcp extends Component {
'btn btn-primary btn-standard btn-loading': dhcp.processingStatus,
});
const {
gateway_ip,
interface_name,
lease_duration,
range_end,
range_start,
subnet_mask,
...values
} = dhcp.config;
const initialForm = {
gateway_ip,
lease_duration,
range_end,
range_start,
subnet_mask,
};
const initialSelect = { interface_name };
return (
<Fragment>
@ -121,14 +109,14 @@ class Dhcp extends Component {
<Fragment>
<Interface
onChange={this.handleFormSubmit}
initialValues={initialSelect}
initialValues={{ interface_name }}
interfaces={dhcp.interfaces}
processing={dhcp.processingInterfaces}
enabled={dhcp.config.enabled}
/>
<Form
onSubmit={this.handleFormSubmit}
initialValues={initialForm}
initialValues={{ ...values }}
interfaces={dhcp.interfaces}
processingConfig={dhcp.processingConfig}
/>

View File

@ -80,7 +80,12 @@ let Settings = (props) => {
</div>
</div>
<div className="setup__desc">
<Trans>install_settings_interface_link</Trans> <a href={`http://${interfaceIp}`}>{`http://${interfaceIp}`}</a>
<Trans
components={[<a href={`http://${interfaceIp}`} key="0">link</a>]}
values={{ link: `http://${interfaceIp}` }}
>
install_settings_interface_link
</Trans>
</div>
</div>
<div className="setup__group">
@ -121,7 +126,12 @@ let Settings = (props) => {
</div>
</div>
<p className="setup__desc">
<Trans>install_settings_dns_desc</Trans> <strong>{dnsIp}</strong>
<Trans
components={[<strong key="0">ip</strong>]}
values={{ ip: dnsIp }}
>
install_settings_dns_desc
</Trans>
</p>
</div>
<Controls invalid={invalid} />