Update web app routes and branding.

master
blallo 2019-08-07 17:53:28 +02:00 committed by blallo
parent 357c74ae10
commit 43057351b9
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F
6 changed files with 12 additions and 9 deletions

View File

@ -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

View File

@ -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>

View File

@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "BotZ",
"name": "BotZ web interface",
"icons": [
{
"src": "favicon.ico",

View File

@ -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}));
}

View File

@ -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.