diff options
-rw-r--r-- | frontend/src/views/Config.js | 21 | ||||
-rw-r--r-- | frontend/src/views/Config.scss | 4 |
2 files changed, 23 insertions, 2 deletions
diff --git a/frontend/src/views/Config.js b/frontend/src/views/Config.js index 1468b1b..f5766eb 100644 --- a/frontend/src/views/Config.js +++ b/frontend/src/views/Config.js @@ -20,7 +20,8 @@ class Config extends Component { showConfig: true, tmpUser:"", tmpPass:"", - tmpConf:"" + tmpConf:"", + errors:"" }; this.serverIpChanged = this.serverIpChanged.bind(this); @@ -71,6 +72,7 @@ class Config extends Component { }) }; + let msg = ""; fetch('/setup', requestOptions) .then(response => { @@ -78,7 +80,12 @@ class Config extends Component { //this.setState({showConfig:false}); this.props.onHide(); this.props.onDone(); - console.log(this.props.disabled); + } else { + response.json().then(data => { + this.setState( + {errors : data.error.toString()} + ); + }); } } ); @@ -215,6 +222,16 @@ class Config extends Component { </Col> </Row> + <Row> + <div class="error"> + <b> + {this.state.errors + .split('\n').map((item, key) => { + return <span key={key}>{item}<br/></span>}) + } + </b> + </div> + </Row> </Container> </Modal.Body> diff --git a/frontend/src/views/Config.scss b/frontend/src/views/Config.scss index b0b899f..331d7a7 100644 --- a/frontend/src/views/Config.scss +++ b/frontend/src/views/Config.scss @@ -49,3 +49,7 @@ } } + +.error{ + color: red; +} |