badguardhome/client/src/containers/Settings.js

85 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-08-30 14:25:33 +00:00
import { connect } from 'react-redux';
import {
initSettings,
toggleSetting,
handleUpstreamChange,
setUpstream,
testUpstream,
addErrorToast,
toggleDhcp,
getDhcpStatus,
2018-12-24 08:48:23 +00:00
getDhcpInterfaces,
setDhcpConfig,
findActiveDhcp,
2019-05-28 12:07:46 +00:00
addStaticLease,
removeStaticLease,
toggleLeaseModal,
} from '../actions';
import {
getTlsStatus,
setTlsConfig,
validateTlsConfig,
} from '../actions/encryption';
2019-05-22 14:59:57 +00:00
import {
addClient,
updateClient,
deleteClient,
toggleClientModal,
} from '../actions/clients';
2019-05-30 14:26:19 +00:00
import {
getAccessList,
setAccessList,
} from '../actions/access';
2018-08-30 14:25:33 +00:00
import Settings from '../components/Settings';
const mapStateToProps = (state) => {
const {
settings,
dashboard,
dhcp,
encryption,
2019-05-22 14:59:57 +00:00
clients,
2019-05-30 14:26:19 +00:00
access,
} = state;
const props = {
settings,
dashboard,
dhcp,
encryption,
2019-05-22 14:59:57 +00:00
clients,
2019-05-30 14:26:19 +00:00
access,
};
2018-08-30 14:25:33 +00:00
return props;
};
const mapDispatchToProps = {
initSettings,
toggleSetting,
handleUpstreamChange,
setUpstream,
testUpstream,
2018-09-21 15:50:06 +00:00
addErrorToast,
toggleDhcp,
getDhcpStatus,
2018-12-24 08:48:23 +00:00
getDhcpInterfaces,
setDhcpConfig,
findActiveDhcp,
getTlsStatus,
setTlsConfig,
validateTlsConfig,
2019-05-22 14:59:57 +00:00
addClient,
updateClient,
deleteClient,
toggleClientModal,
2019-05-28 12:07:46 +00:00
addStaticLease,
removeStaticLease,
toggleLeaseModal,
2019-05-30 14:26:19 +00:00
getAccessList,
setAccessList,
2018-08-30 14:25:33 +00:00
};
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Settings);