aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/views/App.js
diff options
context:
space:
mode:
authortherealbobo2020-09-17 08:42:00 +0000
committertherealbobo2020-09-17 08:42:00 +0000
commit9063c5d4d5b04e4c7f4e689c9246c4b37b72ec68 (patch)
treee59da614e29386daf53f3930851566b00b49e95a /frontend/src/views/App.js
parent4cfdf6e2dfe9184e988a145495e072571d512cdc (diff)
parent98355cdf838d8c18e9a28176ae7a847770545395 (diff)
conflicts fixed and merge
Diffstat (limited to 'frontend/src/views/App.js')
-rw-r--r--frontend/src/views/App.js31
1 files changed, 29 insertions, 2 deletions
diff --git a/frontend/src/views/App.js b/frontend/src/views/App.js
index 6c101fa..ebead2f 100644
--- a/frontend/src/views/App.js
+++ b/frontend/src/views/App.js
@@ -6,6 +6,8 @@ import {BrowserRouter as Router, Route, Switch} from "react-router-dom";
import Services from "./Services";
import Filters from "./Filters";
import Rules from "./Rules";
+import Config from "./Config";
+import Upload from "./Upload";
class App extends Component {
@@ -14,8 +16,22 @@ class App extends Component {
this.state = {
servicesWindowOpen: false,
filterWindowOpen: false,
- rulesWindowOpen: false
+ rulesWindowOpen: false,
+ configWindowOpen: false,
+ uploadWindowOpen: 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});
+ }
+ });
+
+
}
render() {
@@ -29,13 +45,24 @@ class App extends Component {
if (this.state.rulesWindowOpen) {
modal = <Rules onHide={() => this.setState({rulesWindowOpen: false})}/>;
}
+ if (this.state.configWindowOpen) {
+ modal = <Config onHide={() => this.setState({configWindowOpen: false})}
+ onDone={() => this.setState({configDone: true})}/>;
+ }
+ if (this.state.uploadWindowOpen) {
+ modal = <Upload onHide={() => this.setState({uploadWindowOpen: false}) }/>;
+ }
return (
<div className="app">
<Router>
<Header onOpenServices={() => this.setState({servicesWindowOpen: true})}
onOpenFilters={() => this.setState({filterWindowOpen: true})}
- onOpenRules={() => this.setState({rulesWindowOpen: true})} />
+ onOpenRules={() => this.setState({rulesWindowOpen: true})}
+ onOpenConfig={() => this.setState({configWindowOpen: true})}
+ onOpenUpload={() => this.setState({uploadWindowOpen: true})}
+ onConfigDone={this.state.configDone}
+ />
<Switch>
<Route path="/connections/:id" children={<MainPane/>}/>
<Route path="/" children={<MainPane/>}/>