* client: hide error if DHCP enabled and require check DHCP before enabling

This commit is contained in:
Ildar Kamalov 2019-03-28 17:53:02 +03:00 committed by Simon Zolin
parent 6ba0e4686a
commit 24fc2957c5
1 changed files with 8 additions and 3 deletions

View File

@ -51,6 +51,7 @@ class Dhcp extends Component {
onClick={() => this.handleToggle(config)} onClick={() => this.handleToggle(config)}
disabled={ disabled={
!filledConfig !filledConfig
|| !active
|| activeDhcpFound || activeDhcpFound
|| processingDhcp || processingDhcp
|| processingConfig || processingConfig
@ -95,7 +96,7 @@ class Dhcp extends Component {
} }
getDhcpWarning = (active) => { getDhcpWarning = (active) => {
if (active && active.found === false) { if (!active || (active && active.found === false)) {
return ''; return '';
} }
@ -154,10 +155,14 @@ class Dhcp extends Component {
<Trans>check_dhcp_servers</Trans> <Trans>check_dhcp_servers</Trans>
</button> </button>
</div> </div>
{!enabled &&
<Fragment>
{this.getActiveDhcpMessage(t, dhcp.active)} {this.getActiveDhcpMessage(t, dhcp.active)}
{this.getDhcpWarning(dhcp.active)} {this.getDhcpWarning(dhcp.active)}
</Fragment> </Fragment>
} }
</Fragment>
}
</div> </div>
</Card> </Card>
{!dhcp.processing && dhcp.config.enabled && {!dhcp.processing && dhcp.config.enabled &&