Add Index Component
This commit is contained in:
parent
97084ce357
commit
4042591717
|
|
@ -0,0 +1,15 @@
|
||||||
|
import * as AppAction from './AppAction';
|
||||||
|
import * as UserAction from './UserAction';
|
||||||
|
import * as MessageAction from './MessageAction';
|
||||||
|
import * as ClientAction from './ClientAction';
|
||||||
|
|
||||||
|
/** Calls all actions to initialize the state. */
|
||||||
|
export function initialLoad() {
|
||||||
|
AppAction.fetchApps();
|
||||||
|
UserAction.fetchCurrentUser();
|
||||||
|
MessageAction.fetchMessages();
|
||||||
|
MessageAction.listenToWebSocket();
|
||||||
|
ClientAction.fetchClients();
|
||||||
|
UserAction.fetchUsers();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
import React from 'react';
|
||||||
|
import ReactDOM from 'react-dom';
|
||||||
|
import Layout from './Layout';
|
||||||
|
import registerServiceWorker from './registerServiceWorker';
|
||||||
|
import {checkIfAlreadyLoggedIn} from './actions/defaultAxios';
|
||||||
|
import config from 'react-global-configuration';
|
||||||
|
import 'typeface-roboto';
|
||||||
|
import 'typeface-roboto-mono';
|
||||||
|
|
||||||
|
const defaultDevConfig = {
|
||||||
|
url: 'http://localhost:80/',
|
||||||
|
};
|
||||||
|
|
||||||
|
const defaultProdConfig = {
|
||||||
|
url: './',
|
||||||
|
};
|
||||||
|
|
||||||
|
(function clientJS() {
|
||||||
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
config.set(window.config || defaultProdConfig);
|
||||||
|
} else {
|
||||||
|
config.set(window.config || defaultDevConfig);
|
||||||
|
}
|
||||||
|
checkIfAlreadyLoggedIn();
|
||||||
|
ReactDOM.render(<Layout />, document.getElementById('root'));
|
||||||
|
registerServiceWorker();
|
||||||
|
}());
|
||||||
Loading…
Reference in New Issue