2019-06-03 13:08:50 +00:00
|
|
|
import React, { Component, Fragment } from 'react';
|
2019-06-03 12:41:45 +00:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { withNamespaces } from 'react-i18next';
|
|
|
|
|
|
|
|
import Upstream from './Upstream';
|
2019-06-03 13:08:50 +00:00
|
|
|
import Access from './Access';
|
2019-06-03 12:41:45 +00:00
|
|
|
import PageTitle from '../../ui/PageTitle';
|
2019-06-03 13:08:50 +00:00
|
|
|
import Loading from '../../ui/Loading';
|
2019-06-03 12:41:45 +00:00
|
|
|
|
2019-06-03 13:08:50 +00:00
|
|
|
class Dns extends Component {
|
|
|
|
componentDidMount() {
|
|
|
|
this.props.getAccessList();
|
|
|
|
}
|
2019-06-03 12:41:45 +00:00
|
|
|
|
2019-06-03 13:08:50 +00:00
|
|
|
render() {
|
|
|
|
const {
|
|
|
|
t,
|
|
|
|
dashboard,
|
|
|
|
settings,
|
|
|
|
access,
|
|
|
|
setAccessList,
|
|
|
|
testUpstream,
|
|
|
|
setUpstream,
|
|
|
|
} = this.props;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Fragment>
|
|
|
|
<PageTitle title={t('dns_settings')} />
|
|
|
|
{(dashboard.processing || access.processing) && <Loading />}
|
|
|
|
{!dashboard.processing && !access.processing && (
|
|
|
|
<Fragment>
|
|
|
|
<Upstream
|
|
|
|
upstreamDns={dashboard.upstreamDns}
|
|
|
|
bootstrapDns={dashboard.bootstrapDns}
|
|
|
|
allServers={dashboard.allServers}
|
|
|
|
processingTestUpstream={settings.processingTestUpstream}
|
|
|
|
processingSetUpstream={settings.processingSetUpstream}
|
|
|
|
setUpstream={setUpstream}
|
|
|
|
testUpstream={testUpstream}
|
|
|
|
/>
|
|
|
|
<Access access={access} setAccessList={setAccessList} />
|
|
|
|
</Fragment>
|
|
|
|
)}
|
|
|
|
</Fragment>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2019-06-03 12:41:45 +00:00
|
|
|
|
|
|
|
Dns.propTypes = {
|
|
|
|
dashboard: PropTypes.object.isRequired,
|
|
|
|
settings: PropTypes.object.isRequired,
|
|
|
|
setUpstream: PropTypes.func.isRequired,
|
|
|
|
testUpstream: PropTypes.func.isRequired,
|
2019-06-03 13:08:50 +00:00
|
|
|
getAccessList: PropTypes.func.isRequired,
|
|
|
|
setAccessList: PropTypes.func.isRequired,
|
|
|
|
access: PropTypes.object.isRequired,
|
2019-06-03 12:41:45 +00:00
|
|
|
t: PropTypes.func.isRequired,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default withNamespaces()(Dns);
|