@@ -10,3 +10,7 @@
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.form-control--textarea {
|
||||
min-height: 110px;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ export default class Upstream extends Component {
|
||||
<div className="col">
|
||||
<form>
|
||||
<textarea
|
||||
className="form-control"
|
||||
value={this.props.upstream}
|
||||
className="form-control form-control--textarea"
|
||||
value={this.props.upstreamDns}
|
||||
onChange={this.handleChange}
|
||||
/>
|
||||
<div className="card-actions">
|
||||
@@ -63,7 +63,7 @@ export default class Upstream extends Component {
|
||||
}
|
||||
|
||||
Upstream.propTypes = {
|
||||
upstream: PropTypes.string,
|
||||
upstreamDns: PropTypes.string,
|
||||
processingTestUpstream: PropTypes.bool,
|
||||
handleUpstreamChange: PropTypes.func,
|
||||
handleUpstreamSubmit: PropTypes.func,
|
||||
|
||||
@@ -36,16 +36,16 @@ export default class Settings extends Component {
|
||||
}
|
||||
|
||||
handleUpstreamChange = (value) => {
|
||||
this.props.handleUpstreamChange({ upstream: value });
|
||||
this.props.handleUpstreamChange({ upstreamDns: value });
|
||||
};
|
||||
|
||||
handleUpstreamSubmit = () => {
|
||||
this.props.setUpstream(this.props.settings.upstream);
|
||||
this.props.setUpstream(this.props.dashboard.upstreamDns);
|
||||
};
|
||||
|
||||
handleUpstreamTest = () => {
|
||||
if (this.props.settings.upstream.length > 0) {
|
||||
this.props.testUpstream(this.props.settings.upstream);
|
||||
if (this.props.dashboard.upstreamDns.length > 0) {
|
||||
this.props.testUpstream(this.props.dashboard.upstreamDns);
|
||||
} else {
|
||||
this.props.addErrorToast({ error: 'No servers specified' });
|
||||
}
|
||||
@@ -69,7 +69,8 @@ export default class Settings extends Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const { settings, upstream } = this.props;
|
||||
const { settings } = this.props;
|
||||
const { upstreamDns } = this.props.dashboard;
|
||||
return (
|
||||
<Fragment>
|
||||
<PageTitle title="Settings" />
|
||||
@@ -84,7 +85,7 @@ export default class Settings extends Component {
|
||||
</div>
|
||||
</Card>
|
||||
<Upstream
|
||||
upstream={upstream}
|
||||
upstreamDns={upstreamDns}
|
||||
processingTestUpstream={settings.processingTestUpstream}
|
||||
handleUpstreamChange={this.handleUpstreamChange}
|
||||
handleUpstreamSubmit={this.handleUpstreamSubmit}
|
||||
|
||||
Reference in New Issue
Block a user