diff options
author | therealbobo | 2020-09-14 07:45:18 +0000 |
---|---|---|
committer | therealbobo | 2020-09-14 07:45:18 +0000 |
commit | b5f3cd7accf3699fd7ed3053d671a4c254dfeaa3 (patch) | |
tree | a5a4252b12a0d2f1707bdb68322cd45d59d3347e /frontend/src | |
parent | fdf53489eced715e1586f582882cb064721a965e (diff) |
auto startup configuration
Diffstat (limited to 'frontend/src')
-rw-r--r-- | frontend/src/views/App.js | 9 | ||||
-rw-r--r-- | frontend/src/views/Config.js | 9 | ||||
-rw-r--r-- | frontend/src/views/Services.js | 10 |
3 files changed, 14 insertions, 14 deletions
diff --git a/frontend/src/views/App.js b/frontend/src/views/App.js index 229eaed..5b49045 100644 --- a/frontend/src/views/App.js +++ b/frontend/src/views/App.js @@ -18,6 +18,15 @@ class App extends Component { rulesWindowOpen: false, configWindowOpen: false }; + + fetch('/api/services') + .then(response => { + if( response.status === 503){ + this.setState({configWindowOpen: true}); + } + }); + + } render() { diff --git a/frontend/src/views/Config.js b/frontend/src/views/Config.js index 438e2d6..9b220d9 100644 --- a/frontend/src/views/Config.js +++ b/frontend/src/views/Config.js @@ -4,7 +4,6 @@ import { import React, {Component, useState} from 'react'; import './Config.scss'; import {Button, ButtonGroup, ToggleButton, Col, Container, Form, FormControl, InputGroup, Modal, Row, Table} from "react-bootstrap"; -import axios from 'axios' import {createCurlCommand} from '../utils'; class Config extends Component { @@ -74,9 +73,11 @@ class Config extends Component { fetch('/setup', requestOptions) - .then(function(response){ - console.log(response.status); - console.log(response); + .then(response => { + if (response.status === 202 ){ + //this.setState({showConfig:false}); + this.props.onHide(); + } } ); diff --git a/frontend/src/views/Services.js b/frontend/src/views/Services.js index 9f0fbd2..0de021f 100644 --- a/frontend/src/views/Services.js +++ b/frontend/src/views/Services.js @@ -82,16 +82,6 @@ class Services extends Component { } ); - /* - axios.put("/api/services", { - name: this.state.name, - port: this.state.port, - color: this.state.color, - notes: this.state.notes - }); - */ - - this.newService(); this.loadServices(); } |