Update web app routes and branding.
This commit is contained in:
parent
357c74ae10
commit
43057351b9
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "bot.z_web",
|
||||
"version": "0.1.0",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"bootstrap": "^4.3.1",
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 59 KiB |
|
@ -19,7 +19,7 @@
|
|||
work correctly both with client-side routing and a non-root public URL.
|
||||
Learn how to configure a non-root public URL by running `npm run build`.
|
||||
-->
|
||||
<title>React App</title>
|
||||
<title>BotZ</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"short_name": "BotZ",
|
||||
"name": "BotZ web interface",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
|
|
|
@ -2,17 +2,15 @@ import React from 'react';
|
|||
import IndexPage from './IndexPage.js';
|
||||
|
||||
|
||||
const targetUrl = "http://localhost:3003"
|
||||
|
||||
class App extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
this.state = {targetUrl: targetUrl, loggedIn: false}
|
||||
this.state = {targetUrl: props.targetUrl, loggedIn: false}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
fetch(this.targetUrl, {credentials: 'include'})
|
||||
fetch(this.targetUrl + '/status', {credentials: 'include'})
|
||||
.then(response => response.json())
|
||||
.then(data => this.setState({loggedIn: data.logged_in}));
|
||||
}
|
||||
|
|
|
@ -5,7 +5,12 @@ import './index.css';
|
|||
import App from './App';
|
||||
import * as serviceWorker from './serviceWorker';
|
||||
|
||||
ReactDOM.render(<App />, document.getElementById('root'));
|
||||
|
||||
const targetUrl = "/api";
|
||||
// // Dev address //
|
||||
// const targetUrl = "http://localhost:3003/api";
|
||||
|
||||
ReactDOM.render(<App targetUrl={targetUrl}/>, document.getElementById('root'));
|
||||
|
||||
// If you want your app to work offline and load faster, you can change
|
||||
// unregister() to register() below. Note this comes with some pitfalls.
|
||||
|
|
Loading…
Reference in New Issue
Block a user