diff options
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/src/views/App.js | 9 | ||||
-rw-r--r-- | frontend/src/views/Config.js | 4 | ||||
-rw-r--r-- | frontend/src/views/Config.scss | 13 | ||||
-rw-r--r-- | frontend/src/views/Header.js | 3 |
4 files changed, 26 insertions, 3 deletions
diff --git a/frontend/src/views/App.js b/frontend/src/views/App.js index 5b49045..5a2d913 100644 --- a/frontend/src/views/App.js +++ b/frontend/src/views/App.js @@ -16,13 +16,16 @@ class App extends Component { servicesWindowOpen: false, filterWindowOpen: false, rulesWindowOpen: false, - configWindowOpen: false + configWindowOpen: false, + configDone: false }; fetch('/api/services') .then(response => { if( response.status === 503){ this.setState({configWindowOpen: true}); + } else if (response.status === 200){ + this.setState({configDone: true}); } }); @@ -41,7 +44,8 @@ class App extends Component { modal = <Rules onHide={() => this.setState({rulesWindowOpen: false})}/>; } if (this.state.configWindowOpen) { - modal = <Config onHide={() => this.setState({configWindowOpen: false})}/>; + modal = <Config onHide={() => this.setState({configWindowOpen: false})} + onDone={() => this.setState({configDone: true})}/>; } return ( @@ -51,6 +55,7 @@ class App extends Component { onOpenFilters={() => this.setState({filterWindowOpen: true})} onOpenRules={() => this.setState({rulesWindowOpen: true})} onOpenConfig={() => this.setState({configWindowOpen: true})} + onConfigDone={this.state.configDone} /> <Switch> <Route path="/connections/:id" children={<MainPane/>}/> diff --git a/frontend/src/views/Config.js b/frontend/src/views/Config.js index 9b220d9..1468b1b 100644 --- a/frontend/src/views/Config.js +++ b/frontend/src/views/Config.js @@ -77,6 +77,8 @@ class Config extends Component { if (response.status === 202 ){ //this.setState({showConfig:false}); this.props.onHide(); + this.props.onDone(); + console.log(this.props.disabled); } } ); @@ -158,6 +160,8 @@ class Config extends Component { </Modal.Title> </Modal.Header> <Modal.Body> + <div class="blink"><span><b>Warning:</b></span> once the configuration is completed, it cannot be changed unless you reset caronte :(</div> + <hr/> <Container> <Row> <Col md={5}> diff --git a/frontend/src/views/Config.scss b/frontend/src/views/Config.scss index 9946ce9..b0b899f 100644 --- a/frontend/src/views/Config.scss +++ b/frontend/src/views/Config.scss @@ -36,3 +36,16 @@ width: 80px; } } + +.blink{ + + span{ + animation: blink 1s linear infinite; + } + @keyframes blink{ + 0%{opacity: 0;} + 50%{opacity: .5;} + 100%{opacity: 1;} + } + +} diff --git a/frontend/src/views/Header.js b/frontend/src/views/Header.js index 03e4e5c..3f95bcd 100644 --- a/frontend/src/views/Header.js +++ b/frontend/src/views/Header.js @@ -73,7 +73,8 @@ class Header extends Component { <Button variant="yellow" size="sm">pcaps</Button> <Button variant="blue" onClick={this.props.onOpenRules}>rules</Button> <Button variant="red" onClick={this.props.onOpenServices}>services</Button> - <Button variant="green" onClick={this.props.onOpenConfig}>config</Button> + <Button variant="green" onClick={this.props.onOpenConfig} + disabled={this.props.onConfigDone}>config</Button> </div> </div> </div> |