- client: fix upstream DNS servers form

Closes #1000
This commit is contained in:
Ildar Kamalov
2019-09-17 12:22:15 +03:00
parent 48a4df1a9f
commit 0a26ee4224
8 changed files with 360 additions and 296 deletions

View File

@@ -10,6 +10,7 @@ import Loading from '../../ui/Loading';
class Dns extends Component {
componentDidMount() {
this.props.getDnsSettings();
this.props.getAccessList();
this.props.getRewritesList();
}
@@ -30,11 +31,16 @@ class Dns extends Component {
toggleRewritesModal,
} = this.props;
const isDataLoading =
dashboard.processingDnsSettings || access.processing || rewrites.processing;
const isDataReady =
!dashboard.processingDnsSettings && !access.processing && !rewrites.processing;
return (
<Fragment>
<PageTitle title={t('dns_settings')} />
{(dashboard.processing || access.processing) && <Loading />}
{!dashboard.processing && !access.processing && (
{isDataLoading && <Loading />}
{isDataReady && (
<Fragment>
<Upstream
upstreamDns={dashboard.upstreamDns}
@@ -73,6 +79,7 @@ Dns.propTypes = {
addRewrite: PropTypes.func.isRequired,
deleteRewrite: PropTypes.func.isRequired,
toggleRewritesModal: PropTypes.func.isRequired,
getDnsSettings: PropTypes.func.isRequired,
t: PropTypes.func.isRequired,
};