Add enable/disable for DHCP server
This commit is contained in:
committed by
Eugene Bujak
parent
96fbf7f134
commit
d46b65f982
@@ -19,7 +19,7 @@ const columns = [{
|
||||
|
||||
const Leases = props => (
|
||||
<ReactTable
|
||||
data={props.leases}
|
||||
data={props.leases || []}
|
||||
columns={columns}
|
||||
showPagination={false}
|
||||
noDataText={ props.t('dhcp_leases_not_found') }
|
||||
|
||||
@@ -17,12 +17,12 @@ class Dhcp extends Component {
|
||||
}
|
||||
|
||||
getToggleDhcpButton = () => {
|
||||
const { enabled } = this.props.dhcp.config;
|
||||
const buttonText = enabled ? 'dhcp_disable' : 'dhcp_enable';
|
||||
const buttonClass = enabled ? 'btn-gray' : 'btn-success';
|
||||
const { config } = this.props.dhcp;
|
||||
const buttonText = config.enabled ? 'dhcp_disable' : 'dhcp_enable';
|
||||
const buttonClass = config.enabled ? 'btn-gray' : 'btn-success';
|
||||
|
||||
return (
|
||||
<button type="button" className={`btn btn-standart mr-2 ${buttonClass}`} onClick={() => this.props.toggleDhcp(enabled)}>
|
||||
<button type="button" className={`btn btn-standart mr-2 ${buttonClass}`} onClick={() => this.props.toggleDhcp(config)}>
|
||||
<Trans>{buttonText}</Trans>
|
||||
</button>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user