add client copied from nwap
This commit is contained in:
parent
278415ce32
commit
c3ece37824
38 changed files with 13644 additions and 0 deletions
23
client/.gitignore
vendored
Executable file
23
client/.gitignore
vendored
Executable file
|
@ -0,0 +1,23 @@
|
|||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
/.pnp
|
||||
.pnp.js
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
||||
# production
|
||||
/build
|
||||
|
||||
# misc
|
||||
.DS_Store
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
68
client/README.md
Executable file
68
client/README.md
Executable file
|
@ -0,0 +1,68 @@
|
|||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
||||
|
||||
## Available Scripts
|
||||
|
||||
In the project directory, you can run:
|
||||
|
||||
### `npm start`
|
||||
|
||||
Runs the app in the development mode.<br>
|
||||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
|
||||
|
||||
The page will reload if you make edits.<br>
|
||||
You will also see any lint errors in the console.
|
||||
|
||||
### `npm test`
|
||||
|
||||
Launches the test runner in the interactive watch mode.<br>
|
||||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
|
||||
|
||||
### `npm run build`
|
||||
|
||||
Builds the app for production to the `build` folder.<br>
|
||||
It correctly bundles React in production mode and optimizes the build for the best performance.
|
||||
|
||||
The build is minified and the filenames include the hashes.<br>
|
||||
Your app is ready to be deployed!
|
||||
|
||||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
|
||||
|
||||
### `npm run eject`
|
||||
|
||||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
|
||||
|
||||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
|
||||
|
||||
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
|
||||
|
||||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
|
||||
|
||||
## Learn More
|
||||
|
||||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
|
||||
|
||||
To learn React, check out the [React documentation](https://reactjs.org/).
|
||||
|
||||
### Code Splitting
|
||||
|
||||
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
|
||||
|
||||
### Analyzing the Bundle Size
|
||||
|
||||
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
|
||||
|
||||
### Making a Progressive Web App
|
||||
|
||||
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
|
||||
|
||||
### Advanced Configuration
|
||||
|
||||
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
|
||||
|
||||
### Deployment
|
||||
|
||||
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
|
||||
|
||||
### `npm run build` fails to minify
|
||||
|
||||
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify
|
31
client/package.json
Normal file
31
client/package.json
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"name": "client",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"antd": "^3.12.3",
|
||||
"react": "^16.7.0",
|
||||
"react-dom": "^16.7.0",
|
||||
"react-redux": "^5.1.0",
|
||||
"react-router-dom": "^4.3.1",
|
||||
"react-scripts": "2.1.3",
|
||||
"redux": "^4.0.1",
|
||||
"redux-thunk": "^2.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
},
|
||||
"browserslist": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not ie <= 11",
|
||||
"not op_mini all"
|
||||
],
|
||||
"proxy": "http://localhost:3001"
|
||||
}
|
BIN
client/public/favicon.ico
Normal file
BIN
client/public/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
41
client/public/index.html
Executable file
41
client/public/index.html
Executable file
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1, shrink-to-fit=no"
|
||||
/>
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is added to the
|
||||
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
-->
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
<!--
|
||||
Notice the use of %PUBLIC_URL% in the tags above.
|
||||
It will be replaced with the URL of the `public` folder during the build.
|
||||
Only files inside the `public` folder can be referenced from the HTML.
|
||||
|
||||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
|
||||
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>NWAP - Stand der Dinge</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
</body>
|
||||
</html>
|
15
client/public/manifest.json
Executable file
15
client/public/manifest.json
Executable file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"short_name": "React App",
|
||||
"name": "Create React App Sample",
|
||||
"icons": [
|
||||
{
|
||||
"src": "favicon.ico",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
}
|
||||
],
|
||||
"start_url": ".",
|
||||
"display": "standalone",
|
||||
"theme_color": "#000000",
|
||||
"background_color": "#ffffff"
|
||||
}
|
39
client/src/App.css
Executable file
39
client/src/App.css
Executable file
|
@ -0,0 +1,39 @@
|
|||
.App {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.App-logo {
|
||||
animation: App-logo-spin infinite 20s linear;
|
||||
height: 40vmin;
|
||||
}
|
||||
|
||||
.App-header {
|
||||
background-color: #282c34;
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: calc(10px + 2vmin);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.App-link {
|
||||
color: #61dafb;
|
||||
}
|
||||
|
||||
@keyframes App-logo-spin {
|
||||
from {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Super-FamiFont';
|
||||
src: url('./fonts/Super-FamiFont.ttf.eot'); /* IE9 Compat Modes */
|
||||
src: url('./fonts/Super-FamiFont.ttf.woff') format('woff'), /* Pretty Modern Browsers */
|
||||
url('./fonts/Super-FamiFont.ttf.svg') format('svg'); /* Legacy iOS */
|
||||
}
|
17
client/src/App.js
Executable file
17
client/src/App.js
Executable file
|
@ -0,0 +1,17 @@
|
|||
import React, { Component } from 'react';
|
||||
import AppRouter from './components/AppRouter';
|
||||
import { Provider } from 'react-redux';
|
||||
import store from './store'
|
||||
import './App.css';
|
||||
|
||||
class App extends Component {
|
||||
render() {
|
||||
return (
|
||||
<Provider store={store}>
|
||||
<AppRouter />
|
||||
</Provider>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default App;
|
9
client/src/App.test.js
Executable file
9
client/src/App.test.js
Executable file
|
@ -0,0 +1,9 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import App from './App';
|
||||
|
||||
it('renders without crashing', () => {
|
||||
const div = document.createElement('div');
|
||||
ReactDOM.render(<App />, div);
|
||||
ReactDOM.unmountComponentAtNode(div);
|
||||
});
|
218
client/src/actions/appActions.js
Normal file
218
client/src/actions/appActions.js
Normal file
|
@ -0,0 +1,218 @@
|
|||
import ApiService from '../services/ApiService';
|
||||
import {
|
||||
CONFIG_LOADED,
|
||||
CONFIG_LOAD_ERROR,
|
||||
CONFIG_UPDATED,
|
||||
CONFIG_SAVED,
|
||||
OBJECT_STARTED,
|
||||
OBJECT_PAUSED,
|
||||
OBJECT_STOPPED,
|
||||
OBJECT_STATUS_LOADED,
|
||||
FILE_UPLOADED,
|
||||
FILES_LOADED,
|
||||
FILE_DELETED,
|
||||
PARAMS_LOADED,
|
||||
PARAMS_LOAD_ERROR,
|
||||
PLAYERS_LOADED,
|
||||
PLAYERS_LOAD_ERROR
|
||||
} from './types';
|
||||
|
||||
|
||||
export const loadConfig = (onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: CONFIG_LOADED,
|
||||
config: data
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
dispatch({
|
||||
type: CONFIG_LOAD_ERROR,
|
||||
error: error
|
||||
});
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.getConfig(scb, ecb);
|
||||
};
|
||||
|
||||
export const updateConfig = (requestData, onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: CONFIG_UPDATED,
|
||||
config: data
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.udpateConfig(requestData, scb, ecb);
|
||||
};
|
||||
|
||||
export const saveConfig = (onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: CONFIG_SAVED,
|
||||
config: data
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.saveConfig(scb, ecb);
|
||||
};
|
||||
|
||||
export const getObjectConfig = (onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: OBJECT_STATUS_LOADED,
|
||||
status: data.status
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.getObjectStatus(scb, ecb);
|
||||
};
|
||||
|
||||
export const startObject = (onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: OBJECT_STARTED,
|
||||
status: data.status
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.startObject(scb, ecb);
|
||||
};
|
||||
|
||||
export const pauseObject = (onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: OBJECT_PAUSED,
|
||||
status: data.status
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.pauseObject(scb, ecb);
|
||||
};
|
||||
|
||||
export const stopObject = (onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: OBJECT_STOPPED,
|
||||
status: data.status
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.stopObject(scb, ecb);
|
||||
};
|
||||
|
||||
export const fileUploaded = (fileData) => dispatch => {
|
||||
dispatch({
|
||||
type: FILE_UPLOADED,
|
||||
file: fileData
|
||||
});
|
||||
}
|
||||
|
||||
export const loadFiles = (onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: FILES_LOADED,
|
||||
files: data
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.getFiles(scb, ecb);
|
||||
};
|
||||
|
||||
export const uploadFile = (formData, onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: FILE_UPLOADED,
|
||||
file: data
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.uploadFile(formData, scb, ecb);
|
||||
};
|
||||
|
||||
export const deleteFile = (name, onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: FILE_DELETED,
|
||||
fileName: name
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.deleteFile(name, scb, ecb);
|
||||
};
|
||||
|
||||
export const loadParams = (onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: PARAMS_LOADED,
|
||||
params: data
|
||||
});
|
||||
if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
dispatch({
|
||||
type: PARAMS_LOAD_ERROR,
|
||||
error: error
|
||||
});
|
||||
if (onError) onError(error);
|
||||
}
|
||||
service.getParams(scb, ecb);
|
||||
};
|
||||
|
||||
export const loadPlayers = (showId, onSuccess, onError) => dispatch => {
|
||||
const service = new ApiService();
|
||||
const scb = (data) => {
|
||||
dispatch({
|
||||
type: PLAYERS_LOADED,
|
||||
players: data
|
||||
});
|
||||
//if (onSuccess) onSuccess(data);
|
||||
}
|
||||
const ecb = (error) => {
|
||||
dispatch({
|
||||
type: PLAYERS_LOAD_ERROR,
|
||||
error: error
|
||||
});
|
||||
//if (onError) onError(error);
|
||||
}
|
||||
service.getPlayers(showId, scb, ecb);
|
||||
};
|
15
client/src/actions/types.js
Normal file
15
client/src/actions/types.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
export const CONFIG_LOADED = 'CONFIG_LOADED';
|
||||
export const CONFIG_LOAD_ERROR = 'CONFIG_LOAD_ERROR';
|
||||
export const CONFIG_UPDATED = 'CONFIG_SAVED';
|
||||
export const CONFIG_SAVED = 'CONFIG_SAVED';
|
||||
export const OBJECT_STARTED = 'OBJECT_STARTED';
|
||||
export const OBJECT_PAUSED = 'OBJECT_PAUSED';
|
||||
export const OBJECT_STOPPED = 'OBJECT_STOPPED';
|
||||
export const OBJECT_STATUS_LOADED = 'OBJECT_STATUS_LOADED';
|
||||
export const FILE_UPLOADED = 'FILE_UPLOADED';
|
||||
export const FILES_LOADED = 'FILES_LOADED';
|
||||
export const FILE_DELETED = 'FILE_DELETED';
|
||||
export const PARAMS_LOADED = 'PARAMS_LOADED';
|
||||
export const PARAMS_LOAD_ERROR = 'PARAMS_LOAD_ERROR';
|
||||
export const PLAYERS_LOADED = 'PLAYERS_LOADED';
|
||||
export const PLAYERS_LOAD_ERROR = 'PLAYERS_LOAD_ERROR';
|
395
client/src/components/AppConfig/AppConfig.js
Normal file
395
client/src/components/AppConfig/AppConfig.js
Normal file
|
@ -0,0 +1,395 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { loadConfig, updateConfig, saveConfig } from '../../actions/appActions';
|
||||
import { Form, Switch, Select, Input, Button, Icon, Card, Tooltip } from 'antd';
|
||||
import FormItem from 'antd/lib/form/FormItem';
|
||||
import { NumericInput } from '../';
|
||||
|
||||
class AppConfig extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
config: {},
|
||||
loadingConfig: true,
|
||||
updatingConfig: false,
|
||||
savingConfig: false,
|
||||
configLoadError: false,
|
||||
configUpdateError: false,
|
||||
configSaveError: false
|
||||
}
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
let scb = (data) => {
|
||||
if (data.custom === undefined) {
|
||||
data.custom = {};
|
||||
};
|
||||
if (data.custom.printer === undefined) {
|
||||
data.custom.printer = {};
|
||||
}
|
||||
if (data.custom.printer.margins === undefined) {
|
||||
data.custom.printer.margins = {
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
left: 10,
|
||||
right: 10
|
||||
};
|
||||
}
|
||||
this.setState({
|
||||
config: data,
|
||||
loadingConfig: false
|
||||
});
|
||||
}
|
||||
let ecb = (error) => {
|
||||
this.setState({
|
||||
configLoadError: error,
|
||||
loadingConfig: false
|
||||
});
|
||||
}
|
||||
this.props.loadConfig(scb, ecb);
|
||||
}
|
||||
|
||||
updateConfig = (e) => {
|
||||
e.preventDefault();
|
||||
this.setState({
|
||||
updatingConfig: true
|
||||
});
|
||||
|
||||
let scb = (data) => {
|
||||
this.setState({
|
||||
config: data,
|
||||
updatingConfig: false
|
||||
});
|
||||
}
|
||||
let ecb = (error) => {
|
||||
this.setState({
|
||||
configUpdateError: error,
|
||||
updatingConfig: false
|
||||
});
|
||||
}
|
||||
|
||||
this.props.updateConfig(this.state.config, scb, ecb);
|
||||
};
|
||||
|
||||
saveConfig = (e) => {
|
||||
e.preventDefault();
|
||||
this.setState({
|
||||
savingConfig: true
|
||||
});
|
||||
|
||||
let scb = (data) => {
|
||||
this.setState({
|
||||
config: data,
|
||||
savingConfig: false
|
||||
});
|
||||
}
|
||||
let ecb = (error) => {
|
||||
this.setState({
|
||||
configSaveError: error,
|
||||
savingConfig: false
|
||||
});
|
||||
}
|
||||
this.props.saveConfig(scb, ecb);
|
||||
};
|
||||
|
||||
handleChange = name => event => {
|
||||
let v = 0;
|
||||
let c = JSON.parse(JSON.stringify(this.state.config));
|
||||
switch (name) {
|
||||
case 'key':
|
||||
c.objectOptions.key = event.target.value;
|
||||
break;
|
||||
case 'objectType':
|
||||
c.objectType = event;
|
||||
break;
|
||||
case 'secret':
|
||||
c.objectOptions.secret = event.target.value;
|
||||
break;
|
||||
case 'server':
|
||||
c.objectOptions.server = event.target.value;
|
||||
break;
|
||||
case 'dataDir':
|
||||
c.dataDir = event.target.value;
|
||||
break;
|
||||
case 'tempDir':
|
||||
c.tempDir = event.target.value;
|
||||
break;
|
||||
case 'polling':
|
||||
const pi = parseInt(event, 10);
|
||||
c.objectOptions.pollingInterval = pi;
|
||||
break;
|
||||
case 'start':
|
||||
c.startsImmediately = !c.startsImmediately;
|
||||
break;
|
||||
case 'printermargintop':
|
||||
v = parseInt(event, 10);
|
||||
c.custom.printer.margins.top = v;
|
||||
break;
|
||||
case 'printermarginbottom':
|
||||
v = parseInt(event, 10);
|
||||
c.custom.printer.margins.bottom = v;
|
||||
break;
|
||||
case 'printermarginleft':
|
||||
v = parseInt(event, 10);
|
||||
c.custom.printer.margins.left = v;
|
||||
break;
|
||||
case 'printermarginright':
|
||||
v = parseInt(event, 10);
|
||||
c.custom.printer.margins.right = v;
|
||||
break;
|
||||
case 'printerAdditionalCmdArgs':
|
||||
c.custom.printer.additionalCmdArgs = event.target.value;
|
||||
break;
|
||||
default:
|
||||
// do nothing
|
||||
}
|
||||
this.setState({
|
||||
config: c
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
const formItemLayout = {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 8 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 16 },
|
||||
},
|
||||
};
|
||||
|
||||
const tailFormItemLayout = {
|
||||
wrapperCol: {
|
||||
xs: {
|
||||
span: 24,
|
||||
offset: 0,
|
||||
},
|
||||
sm: {
|
||||
span: 16,
|
||||
offset: 8,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
let updateButtonDisabled = JSON.stringify(this.props.config) === JSON.stringify(this.state.config);
|
||||
|
||||
let saveButtonDisabled = true;
|
||||
if (updateButtonDisabled === true && this.state.config.saved === false) saveButtonDisabled = false;
|
||||
|
||||
let error = '';
|
||||
if (this.state.configUpdateError) error = this.state.configUpdateError;
|
||||
if (this.state.configSaveError) error = this.state.configSaveError;
|
||||
|
||||
const Option = Select.Option;
|
||||
|
||||
return (
|
||||
|
||||
<Card title="application config">
|
||||
|
||||
{this.state.loadingConfig &&
|
||||
<pre>loading config...</pre>
|
||||
}
|
||||
|
||||
{!this.state.loadingConfig &&
|
||||
<Form>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Determines if the server should start polling immediately after bootup.'>
|
||||
<span>starts immediately</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<Switch
|
||||
checked={this.state.config.startsImmediately}
|
||||
onChange={this.handleChange('start')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Select the type of the object.'>
|
||||
<span>object type</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<Select defaultValue={this.state.config.objectType} style={{ width: 150 }} onChange={this.handleChange('objectType')}>
|
||||
<Option value='default'>Default</Option>
|
||||
<Option value='osc'>OSC</Option>
|
||||
<Option value="printer">Printer</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Enter the path to the data directory.'>
|
||||
<span>data directory</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<Input
|
||||
value={this.state.config.dataDir}
|
||||
onChange={this.handleChange('dataDir')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Enter the path to the temp directory.'>
|
||||
<span>temp directory</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<Input
|
||||
value={this.state.config.tempDir}
|
||||
onChange={this.handleChange('tempDir')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Enter the url of the toto object service instance.'>
|
||||
<span>server</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<Input
|
||||
value={this.state.config.objectOptions.server}
|
||||
onChange={this.handleChange('server')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Enter the key of the toto object.'>
|
||||
<span>object key</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<Input
|
||||
value={this.state.config.objectOptions.key}
|
||||
onChange={this.handleChange('key')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Enter the secret of the toto object.'>
|
||||
<span>object secret</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<Input
|
||||
value={this.state.config.objectOptions.secret}
|
||||
onChange={this.handleChange('secret')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='How often should the object ask for new payloads.'>
|
||||
<span>polling interval</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<NumericInput
|
||||
style={{ width: 80 }}
|
||||
value={this.state.config.objectOptions.pollingInterval}
|
||||
onChange={this.handleChange('polling')} />
|
||||
</Form.Item>
|
||||
<FormItem {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='If it is saved on the object so it will automatically load when start the device up.'>
|
||||
<span>saved</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
{this.state.config.saved &&
|
||||
<Icon type="check" />
|
||||
}
|
||||
</FormItem>
|
||||
<hr />
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='custom printer processor properties'>
|
||||
<span>custom printer</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Margin top.'>
|
||||
<span>margin top</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<NumericInput
|
||||
style={{ width: 80 }}
|
||||
value={this.state.config.custom.printer.margins.top}
|
||||
onChange={this.handleChange('printermargintop')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Margin bottom.'>
|
||||
<span>margin bottom</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<NumericInput
|
||||
style={{ width: 80 }}
|
||||
value={this.state.config.custom.printer.margins.bottom}
|
||||
onChange={this.handleChange('printermarginbottom')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Margin left.'>
|
||||
<span>margin left</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<NumericInput
|
||||
style={{ width: 80 }}
|
||||
value={this.state.config.custom.printer.margins.left}
|
||||
onChange={this.handleChange('printermarginleft')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Margin right.'>
|
||||
<span>margin right</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<NumericInput
|
||||
style={{ width: 80 }}
|
||||
value={this.state.config.custom.printer.margins.right}
|
||||
onChange={this.handleChange('printermarginright')} />
|
||||
</Form.Item>
|
||||
<Form.Item {...formItemLayout}
|
||||
label={(
|
||||
<Tooltip title='Enter additional command line arguments.'>
|
||||
<span>additional cmd args</span>
|
||||
</Tooltip>
|
||||
)}>
|
||||
<Input
|
||||
value={this.state.config.custom.printer.additionalCmdArgs}
|
||||
onChange={this.handleChange('printerAdditionalCmdArgs')} />
|
||||
</Form.Item>
|
||||
<hr />
|
||||
<Form.Item {...tailFormItemLayout}>
|
||||
<Button
|
||||
style={{ width: 100 }}
|
||||
disabled={updateButtonDisabled}
|
||||
type="primary"
|
||||
onClick={this.updateConfig}>
|
||||
update
|
||||
</Button>
|
||||
<Button
|
||||
style={{ marginLeft: 20, width: 100 }}
|
||||
disabled={saveButtonDisabled}
|
||||
type="primary"
|
||||
onClick={this.saveConfig}>
|
||||
save
|
||||
</Button>
|
||||
</Form.Item>
|
||||
<FormItem {...tailFormItemLayout}
|
||||
validateStatus="error"
|
||||
help={error.message}>
|
||||
</FormItem>
|
||||
</Form>
|
||||
}
|
||||
</Card>
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
AppConfig.propTypes = {
|
||||
loadConfig: PropTypes.func.isRequired,
|
||||
updateConfig: PropTypes.func.isRequired,
|
||||
saveConfig: PropTypes.func.isRequired,
|
||||
config: PropTypes.object
|
||||
}
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
config: state.appData.config,
|
||||
configLoadError: state.appData.configLoadError
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, { loadConfig, updateConfig, saveConfig })(AppConfig);
|
99
client/src/components/AppHeader/AppHeader.js
Normal file
99
client/src/components/AppHeader/AppHeader.js
Normal file
|
@ -0,0 +1,99 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { loadParams } from '../../actions/appActions';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { withRouter } from "react-router";
|
||||
import { Layout, Menu } from 'antd';
|
||||
import 'antd/dist/antd.css';
|
||||
|
||||
const { Header } = Layout;
|
||||
|
||||
const styles = {
|
||||
logo: {
|
||||
float: 'left',
|
||||
color: 'white',
|
||||
fontSize: '1.4em',
|
||||
marginRight: 30,
|
||||
fontFamily: 'Super-FamiFont'
|
||||
},
|
||||
|
||||
logoImage: {
|
||||
float: 'left',
|
||||
color: 'white',
|
||||
marginRight: 30,
|
||||
marginTop: 7,
|
||||
height: 50,
|
||||
width: 50
|
||||
},
|
||||
|
||||
hiddenShowId: {
|
||||
color: '#3399cc'
|
||||
}
|
||||
}
|
||||
|
||||
class AppHeader extends Component {
|
||||
|
||||
reloadParams = () => {
|
||||
this.props.loadParams();
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
let selectedKeys = [];
|
||||
if (this.props.location.pathname === '/controls') selectedKeys = (['controls']);
|
||||
if (this.props.location.pathname === '/config') selectedKeys = (['config']);
|
||||
if (this.props.location.pathname === '/files') selectedKeys = (['files']);
|
||||
let menu;
|
||||
if (selectedKeys.length > 0) {
|
||||
menu =
|
||||
<Menu
|
||||
theme="dark"
|
||||
mode="horizontal"
|
||||
selectedKeys={selectedKeys}
|
||||
style={{ lineHeight: '64px' }}>
|
||||
<Menu.Item key="controls">
|
||||
<Link to="/controls">controls</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="config">
|
||||
<Link to="/config">config</Link>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="files">
|
||||
<Link to="/files">files</Link>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
}
|
||||
|
||||
let currentShow = this.props.params.find((param) => {
|
||||
return param.key === 'current show';
|
||||
});
|
||||
if (currentShow) {
|
||||
currentShow = currentShow.value;
|
||||
} else {
|
||||
currentShow = '';
|
||||
}
|
||||
|
||||
return (
|
||||
<Header style={{ position: 'fixed', zIndex: 1, width: '100%', background: '#3399cc' }}>
|
||||
<div style={styles.logo}>
|
||||
<img style={styles.logoImage} src='images/nwap_logo.png' alt='' onClick={this.reloadParams} />
|
||||
<Link style={styles.logo} to="/">Post Labour Index</Link>
|
||||
<span style={styles.hiddenShowId}>{currentShow}</span>
|
||||
</div>
|
||||
{menu}
|
||||
</Header>
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
AppHeader.propTypes = {
|
||||
loadParams: PropTypes.func.isRequired,
|
||||
params: PropTypes.array
|
||||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
params: state.appData.params,
|
||||
paramsLoadError: state.appData.paramsLoadError
|
||||
});
|
||||
|
||||
export default withRouter(connect(mapStateToProps, { loadParams })(AppHeader));
|
49
client/src/components/AppRouter.js
Normal file
49
client/src/components/AppRouter.js
Normal file
|
@ -0,0 +1,49 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { loadParams } from '../actions/appActions';
|
||||
import { BrowserRouter as Router, Route } from 'react-router-dom';
|
||||
import { ConfigPage, ControlsPage, FilesPage, ScoreboardPage } from '../pages';
|
||||
import { Layout } from 'antd';
|
||||
import { AppHeader } from '../components';
|
||||
import 'antd/dist/antd.css';
|
||||
|
||||
const { Content } = Layout;
|
||||
|
||||
class AppRouter extends Component {
|
||||
|
||||
componentWillMount() {
|
||||
this.props.loadParams();
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<Router>
|
||||
<Layout style={{height:"100%"}}>
|
||||
<AppHeader />
|
||||
<Content style={{ padding: '0 50px', marginTop: 64 }}>
|
||||
<div style={{ background: '#fff', padding: 24, minHeight: '100%' }}>
|
||||
<Route exact path='/' component={ScoreboardPage} />
|
||||
<Route exact path='/controls' component={ControlsPage} />
|
||||
<Route exact path='/config' component={ConfigPage} />
|
||||
<Route exact path='/files' component={FilesPage} />
|
||||
</div>
|
||||
</Content>
|
||||
</Layout>
|
||||
</Router>
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
AppRouter.propTypes = {
|
||||
loadParams: PropTypes.func.isRequired,
|
||||
params: PropTypes.array
|
||||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
params: state.appData.players,
|
||||
paramsLoadError: state.appData.paramsLoadError
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, { loadParams })(AppRouter);
|
71
client/src/components/FileList/FileList.js
Normal file
71
client/src/components/FileList/FileList.js
Normal file
|
@ -0,0 +1,71 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { loadFiles, deleteFile } from '../../actions/appActions';
|
||||
import { Card, Table, Button, notification } from 'antd';
|
||||
|
||||
class FileList extends Component {
|
||||
|
||||
componentWillMount() {
|
||||
this.props.loadFiles();
|
||||
};
|
||||
|
||||
openNotificationWithIcon = (type, title, description) => {
|
||||
notification[type]({
|
||||
message: title,
|
||||
description: description,
|
||||
});
|
||||
};
|
||||
|
||||
_deleteFile(record) {
|
||||
let _this = this;
|
||||
const scb = (data) => {
|
||||
_this.openNotificationWithIcon('success', 'File deleted', '');
|
||||
}
|
||||
const ecb = (error) => {
|
||||
_this.openNotificationWithIcon('error', 'Error deleting file', error.message);
|
||||
}
|
||||
this.props.deleteFile(record.name, scb, ecb);
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
const _this = this;
|
||||
|
||||
const columns = [{
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
}, {
|
||||
title: 'Action',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<Button
|
||||
type='danger'
|
||||
size='small'
|
||||
onClick={() => _this._deleteFile(record)}>
|
||||
delete
|
||||
</Button>
|
||||
)
|
||||
}];
|
||||
|
||||
return (
|
||||
<Card title='files'>
|
||||
<Table dataSource={this.props.files} columns={columns} />
|
||||
</Card>
|
||||
)
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
FileList.propTypes = {
|
||||
loadFiles: PropTypes.func.isRequired,
|
||||
deleteFile: PropTypes.func.isRequired,
|
||||
files: PropTypes.array
|
||||
}
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
files: state.appData.files
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, { loadFiles, deleteFile })(FileList);
|
77
client/src/components/FileUpload/FileUpload.js
Normal file
77
client/src/components/FileUpload/FileUpload.js
Normal file
|
@ -0,0 +1,77 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { uploadFile, fileUploaded } from '../../actions/appActions';
|
||||
import { Button, Icon, Card, Upload, notification } from 'antd';
|
||||
|
||||
class FileUpload extends Component {
|
||||
|
||||
openNotificationWithIcon = (type, title, description) => {
|
||||
notification[type]({
|
||||
message: title,
|
||||
description: description,
|
||||
});
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
let _this = this;
|
||||
|
||||
const uploadProps = {
|
||||
action: '/api/files',
|
||||
multiple: false,
|
||||
headers: {},
|
||||
onStart(file) {
|
||||
},
|
||||
onSuccess(ret, file) {
|
||||
_this.openNotificationWithIcon('success', 'Upload successful', '');
|
||||
},
|
||||
onError(err) {
|
||||
_this.openNotificationWithIcon('error', 'Upload failed', err.message);
|
||||
},
|
||||
onProgress({ percent }, file) {
|
||||
console.log('onProgress', `${percent}%`, file.name);
|
||||
},
|
||||
customRequest({
|
||||
action,
|
||||
data,
|
||||
file,
|
||||
filename,
|
||||
headers,
|
||||
onError,
|
||||
onProgress,
|
||||
onSuccess,
|
||||
}) {
|
||||
const formData = new FormData();
|
||||
formData.append(filename, file);
|
||||
|
||||
_this.props.uploadFile(formData, onSuccess, onError);
|
||||
|
||||
return {
|
||||
abort() {
|
||||
console.log('upload progress is aborted.');
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
return (
|
||||
<Card title='file upload'>
|
||||
<Upload {...uploadProps}>
|
||||
<Button>
|
||||
<Icon type="upload" /> Click to Upload
|
||||
</Button>
|
||||
</Upload>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
};
|
||||
|
||||
FileUpload.propTypes = {
|
||||
uploadFile: PropTypes.func.isRequired,
|
||||
fileUploaded: PropTypes.func.isRequired
|
||||
}
|
||||
|
||||
const mapStateToProps = state => ({});
|
||||
|
||||
export default connect(mapStateToProps, {uploadFile, fileUploaded })(FileUpload);
|
42
client/src/components/NumericInput/NumericInput.js
Normal file
42
client/src/components/NumericInput/NumericInput.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Input } from 'antd';
|
||||
|
||||
class NumericInput extends Component {
|
||||
|
||||
formatNumber = (value) => {
|
||||
value += '';
|
||||
const list = value.split('.');
|
||||
const prefix = list[0].charAt(0) === '-' ? '-' : '';
|
||||
let num = prefix ? list[0].slice(1) : list[0];
|
||||
let result = '';
|
||||
while (num.length > 3) {
|
||||
result = `,${num.slice(-3)}${result}`;
|
||||
num = num.slice(0, num.length - 3);
|
||||
}
|
||||
if (num) {
|
||||
result = num + result;
|
||||
}
|
||||
return `${prefix}${result}${list[1] ? `.${list[1]}` : ''}`;
|
||||
}
|
||||
|
||||
onChange = (e) => {
|
||||
const { value } = e.target;
|
||||
const reg = /^-?(0|[1-9][0-9]*)(\.[0-9]*)?$/;
|
||||
if ((!Number.isNaN(value) && reg.test(value)) || value === '' || value === '-') {
|
||||
this.props.onChange(value);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Input
|
||||
{...this.props}
|
||||
onChange={this.onChange}
|
||||
placeholder="Input a number"
|
||||
maxLength={25}
|
||||
/>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default NumericInput;
|
166
client/src/components/PostLabourIndex/PostLabourIndex.js
Normal file
166
client/src/components/PostLabourIndex/PostLabourIndex.js
Normal file
|
@ -0,0 +1,166 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { withRouter } from "react-router";
|
||||
import { loadPlayers, loadParams } from '../../actions/appActions';
|
||||
import { Avatar } from 'antd';
|
||||
|
||||
const styles = {
|
||||
rowGrundig: {
|
||||
backgroundColor: '#333',
|
||||
color: '#eee',
|
||||
border: '1px solid lightgrey'
|
||||
},
|
||||
rowNormal: {
|
||||
backgroundColor: 'white',
|
||||
color: '#111',
|
||||
border: '1px solid lightgrey'
|
||||
},
|
||||
tbl: {
|
||||
border: '1px solid lightgrey',
|
||||
cellPadding: '4',
|
||||
cellSpacing: '4'
|
||||
},
|
||||
hiddenText: {
|
||||
color: 'white'
|
||||
},
|
||||
textGrundig: {
|
||||
fontSize: '1.8em',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
};
|
||||
|
||||
class PostLabourIndex extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
players: [],
|
||||
playersLoadError: false,
|
||||
params: []
|
||||
};
|
||||
this.loadPlayerInterval = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.loadPlayerInterval = setInterval(
|
||||
() => this.loadPlayers(),
|
||||
3000
|
||||
);
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
clearInterval(this.loadPlayerInterval);
|
||||
};
|
||||
|
||||
loadPlayers = () => {
|
||||
let currentShow = this.props.params.find((param) => {
|
||||
return param.key === 'current show';
|
||||
});
|
||||
if (currentShow) {
|
||||
this.props.loadPlayers(currentShow.value);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
const tableHeight = window.innerHeight - 150;
|
||||
const tableContentStyle = {
|
||||
tblContent: {
|
||||
overflow: 'scroll',
|
||||
height: tableHeight
|
||||
}
|
||||
}
|
||||
|
||||
let orderedPlayers = this.props.players.sort(function (a, b) {
|
||||
return b.values.score - a.values.score;
|
||||
});
|
||||
|
||||
for (var i = 0; i < orderedPlayers.length; i++) {
|
||||
orderedPlayers[i].standing = i + 1;
|
||||
}
|
||||
|
||||
const rows = orderedPlayers.map((player) => {
|
||||
const standing = <td>{player.standing}</td>
|
||||
const avatar = <td><Avatar size={64} src={'https://platform.thegameisover.de/v2/account/' + player.playerId + '/avatar?v=s'} /></td>
|
||||
const name = <td>{player.name}</td>
|
||||
if (player.group === 'grundig') {
|
||||
return (
|
||||
<tr style={styles.rowGrundig} key={player.standing}>
|
||||
{standing}
|
||||
{avatar}
|
||||
{name}
|
||||
<td colSpan="6" align='center'><span style={styles.textGrundig}>G.R.UN.DIG.</span></td>
|
||||
</tr>
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
<tr style={styles.rowNormal} key={player.standing}>
|
||||
{standing}
|
||||
{avatar}
|
||||
{name}
|
||||
<td>{player.cluster}</td>
|
||||
<td style={styles.hiddenText}>{player.values.lust}</td>
|
||||
<td>{player.values.power}</td>
|
||||
<td>{player.values.psyche}</td>
|
||||
<td>{player.values.structure}</td>
|
||||
<td><span style={{ fontWeight: 'bold', fontSize: '1.2em' }}>{player.values.score}</span></td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
<table width='100%' cellPadding='5' border='0' style={styles.tbl}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="50px"></th>
|
||||
<th width="100px">Avatar</th>
|
||||
<th width="25%">Name</th>
|
||||
<th width="25%">Berufsfeld</th>
|
||||
<th width="50px"></th>
|
||||
<th width="100px">Macht</th>
|
||||
<th width="100px">Psyche</th>
|
||||
<th width="100px">Struktur</th>
|
||||
<th width="150px">Post Labour Score</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<div style={tableContentStyle.tblContent}>
|
||||
<table width='100%' border='0' cellPadding='5' style={styles.tbl}>
|
||||
<tbody>
|
||||
{rows}
|
||||
<tr style={{ color: 'white' }}>
|
||||
<td width="50px"></td>
|
||||
<td width="100px"> </td>
|
||||
<td width="25%"> </td>
|
||||
<td width="25%">num player: {orderedPlayers.length}</td>
|
||||
<td width="50px"> </td>
|
||||
<td width="100px"> </td>
|
||||
<td width="100px"> </td>
|
||||
<td width="100px"> </td>
|
||||
<td width="150px"> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
PostLabourIndex.propTypes = {
|
||||
loadPlayers: PropTypes.func.isRequired,
|
||||
players: PropTypes.array,
|
||||
loadParams: PropTypes.func.isRequired,
|
||||
params: PropTypes.array
|
||||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
players: state.appData.players,
|
||||
playersLoadError: state.appData.playersLoadError,
|
||||
params: state.appData.params
|
||||
});
|
||||
|
||||
export default withRouter(connect(mapStateToProps, { loadPlayers, loadParams })(PostLabourIndex));
|
126
client/src/components/Scoreboard/Scoreboard.js
Normal file
126
client/src/components/Scoreboard/Scoreboard.js
Normal file
|
@ -0,0 +1,126 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { loadPlayers, loadParams } from '../../actions/appActions';
|
||||
import { Avatar, Table } from 'antd';
|
||||
|
||||
class Scoreboard extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
players: [],
|
||||
playersLoadError: false,
|
||||
params: []
|
||||
};
|
||||
this.loadPlayerInterval = null;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.loadPlayerInterval = setInterval(
|
||||
() => this.loadPlayers(),
|
||||
3000
|
||||
);
|
||||
};
|
||||
|
||||
componentWillUnmount() {
|
||||
clearInterval(this.loadPlayerInterval);
|
||||
};
|
||||
|
||||
loadPlayers = () => {
|
||||
let currentShow = this.props.params.find((param) => {
|
||||
return param.key === 'current show';
|
||||
});
|
||||
if (currentShow) {
|
||||
this.props.loadPlayers(currentShow.value);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
|
||||
let orderedPlayers = this.props.players.sort(function (a, b) {
|
||||
return b.values.score - a.values.score;
|
||||
});
|
||||
|
||||
for (var i = 0; i < orderedPlayers.length; i++) {
|
||||
orderedPlayers[i].standing = i + 1;
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '',
|
||||
dataIndex: 'standing',
|
||||
key: 'standing',
|
||||
width: 50
|
||||
}, {
|
||||
title: 'Avatar',
|
||||
dataIndex: 'playerId',
|
||||
key: 'playerId',
|
||||
width: 100,
|
||||
render: (playerId) => (
|
||||
<Avatar size={64} src={'https://platform.thegameisover.de/v2/account/' + playerId + '/avatar?v=s'} />
|
||||
)
|
||||
}, {
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
style: 'tableHeader'
|
||||
}, {
|
||||
title: 'Berufsfeld',
|
||||
dataIndex: 'cluster',
|
||||
key: 'cluster'
|
||||
}, {
|
||||
title: 'Macht',
|
||||
dataIndex: 'values.power',
|
||||
key: 'macht',
|
||||
width: 100
|
||||
}, {
|
||||
title: 'Psyche',
|
||||
dataIndex: 'values.psyche',
|
||||
key: 'psyche',
|
||||
width: 100
|
||||
}, {
|
||||
title: 'Struktur',
|
||||
dataIndex: 'values.structure',
|
||||
key: 'structure',
|
||||
width: 100
|
||||
}, {
|
||||
title: 'Post Labour Score',
|
||||
dataIndex: 'values.score',
|
||||
key: 'score',
|
||||
width: 200,
|
||||
render: (score) => (
|
||||
<span style={{ fontWeight: 'bold', fontSize: '1.2em' }}>{score}</span>
|
||||
)
|
||||
}
|
||||
]
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Table
|
||||
columns={columns}
|
||||
dataSource={orderedPlayers}
|
||||
pagination={false}
|
||||
rowKey='id'
|
||||
size="small"
|
||||
bordered
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Scoreboard.propTypes = {
|
||||
loadPlayers: PropTypes.func.isRequired,
|
||||
players: PropTypes.array,
|
||||
loadParams: PropTypes.func.isRequired,
|
||||
params: PropTypes.array
|
||||
};
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
players: state.appData.players,
|
||||
playersLoadError: state.appData.playersLoadError,
|
||||
params: state.appData.params
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, { loadPlayers, loadParams })(Scoreboard);
|
101
client/src/components/TotoObjectControls/TotoObjectControls.js
Normal file
101
client/src/components/TotoObjectControls/TotoObjectControls.js
Normal file
|
@ -0,0 +1,101 @@
|
|||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { Card, Button, notification } from 'antd';
|
||||
import { startObject, pauseObject, stopObject, getObjectConfig } from '../../actions/appActions';
|
||||
|
||||
class TotoObjectControls extends Component {
|
||||
|
||||
componentWillMount() {
|
||||
this.props.getObjectConfig();
|
||||
}
|
||||
|
||||
openNotificationWithIcon = (type, title, description) => {
|
||||
notification[type]({
|
||||
message: title,
|
||||
description: description,
|
||||
});
|
||||
};
|
||||
|
||||
_startObject = () => {
|
||||
const scb = (data) => {
|
||||
this.openNotificationWithIcon('success', 'object started', '');
|
||||
}
|
||||
const ecb = (error) => {
|
||||
this.openNotificationWithIcon('error', 'error starting object', error.message);
|
||||
}
|
||||
this.props.startObject(scb, ecb);
|
||||
}
|
||||
|
||||
_pauseObject = () => {
|
||||
const scb = (data) => {
|
||||
this.openNotificationWithIcon('success', 'object paused', '');
|
||||
}
|
||||
const ecb = (error) => {
|
||||
this.openNotificationWithIcon('error', 'error pausing object', error.message);
|
||||
}
|
||||
this.props.pauseObject(scb, ecb);
|
||||
}
|
||||
|
||||
_stopObject = () => {
|
||||
const scb = (data) => {
|
||||
this.openNotificationWithIcon('success', 'object stopped', '');
|
||||
}
|
||||
const ecb = (error) => {
|
||||
this.openNotificationWithIcon('error', 'error stopping object', error.message);
|
||||
}
|
||||
this.props.stopObject(scb, ecb);
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
const startObjectDisabled = this.props.status === 'running';
|
||||
const pauseObjectDisabled = this.props.status === 'paused' || this.props.status === 'stopped';
|
||||
const stopObjectDisabled = this.props.status === 'stopped';
|
||||
|
||||
return (
|
||||
<Card title="toto-object controlls">
|
||||
<div style={{marginBottom: 30}}>
|
||||
<h4>status: {this.props.status}</h4>
|
||||
</div>
|
||||
<div>
|
||||
<Button
|
||||
style={{ width: 120 }}
|
||||
onClick={this._startObject}
|
||||
type='primary'
|
||||
disabled={startObjectDisabled}>
|
||||
start
|
||||
</Button>
|
||||
<Button
|
||||
style={{ width: 120, marginLeft: 20 }}
|
||||
onClick={this._pauseObject}
|
||||
type='primary'
|
||||
disabled={pauseObjectDisabled}>
|
||||
pause
|
||||
</Button>
|
||||
<Button
|
||||
style={{ width: 120, marginLeft: 20 }}
|
||||
onClick={this._stopObject}
|
||||
type='primary'
|
||||
disabled={stopObjectDisabled}>
|
||||
stop
|
||||
</Button>
|
||||
</div>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
TotoObjectControls.propTypes = {
|
||||
getObjectConfig: PropTypes.func.isRequired,
|
||||
startObject: PropTypes.func.isRequired,
|
||||
pauseObject: PropTypes.func.isRequired,
|
||||
stopObject: PropTypes.func.isRequired,
|
||||
status: PropTypes.string
|
||||
}
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
status: state.appData.status
|
||||
});
|
||||
|
||||
export default connect(mapStateToProps, { startObject, pauseObject, stopObject, getObjectConfig })(TotoObjectControls);
|
19
client/src/components/index.js
Normal file
19
client/src/components/index.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
import AppConfig from './AppConfig/AppConfig';
|
||||
import AppHeader from './AppHeader/AppHeader';
|
||||
import FileList from './FileList/FileList';
|
||||
import FileUpload from './FileUpload/FileUpload';
|
||||
import NumericInput from './NumericInput/NumericInput';
|
||||
import PostLabourIndex from './PostLabourIndex/PostLabourIndex';
|
||||
import Scoreboard from './Scoreboard/Scoreboard';
|
||||
import TotoObjectControls from './TotoObjectControls/TotoObjectControls';
|
||||
|
||||
export {
|
||||
AppConfig,
|
||||
AppHeader,
|
||||
FileList,
|
||||
FileUpload,
|
||||
NumericInput,
|
||||
PostLabourIndex,
|
||||
Scoreboard,
|
||||
TotoObjectControls
|
||||
};
|
BIN
client/src/fonts/Super-FamiFont.ttf.eot
Normal file
BIN
client/src/fonts/Super-FamiFont.ttf.eot
Normal file
Binary file not shown.
518
client/src/fonts/Super-FamiFont.ttf.svg
Normal file
518
client/src/fonts/Super-FamiFont.ttf.svg
Normal file
|
@ -0,0 +1,518 @@
|
|||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg>
|
||||
<metadata>
|
||||
Created by FontForge 20090622 at Mon Jul 2 10:48:03 2018
|
||||
By ffonts
|
||||
Made by 629Fonts. 2017. All Rights Reserved
|
||||
</metadata>
|
||||
<defs>
|
||||
<font id="SuperFamiFont" horiz-adv-x="252" >
|
||||
<font-face
|
||||
font-family="Super FamiFont"
|
||||
font-weight="400"
|
||||
font-stretch="normal"
|
||||
units-per-em="2048"
|
||||
panose-1="2 0 5 0 0 0 0 0 0 0"
|
||||
ascent="1638"
|
||||
descent="-410"
|
||||
x-height="1434"
|
||||
cap-height="1434"
|
||||
bbox="91 0 2818 1664"
|
||||
underline-thickness="150"
|
||||
underline-position="-292"
|
||||
unicode-range="U+0020-U+F002"
|
||||
/>
|
||||
<missing-glyph horiz-adv-x="1914"
|
||||
d="M381 1664h128v-1408h-128v1408zM637 1664h128v-1408h-128v1408zM1149 384v1280h640v-1664h-1664v1664h128v-1536h640v1536h128v-1280h128zM1021 256v-128h128v128h-128z" />
|
||||
<glyph glyph-name=".notdef" horiz-adv-x="1914"
|
||||
d="M381 1664h128v-1408h-128v1408zM637 1664h128v-1408h-128v1408zM1149 384v1280h640v-1664h-1664v1664h128v-1536h640v1536h128v-1280h128zM1021 256v-128h128v128h-128z" />
|
||||
<glyph glyph-name=".null"
|
||||
/>
|
||||
<glyph glyph-name="nonmarkingreturn"
|
||||
/>
|
||||
<glyph glyph-name="space" unicode=" " horiz-adv-x="500"
|
||||
/>
|
||||
<glyph glyph-name="space" unicode=" " horiz-adv-x="500"
|
||||
/>
|
||||
<glyph glyph-name="exclam" unicode="!"
|
||||
/>
|
||||
<glyph glyph-name="quotedbl" unicode="""
|
||||
/>
|
||||
<glyph glyph-name="numbersign" unicode="#"
|
||||
/>
|
||||
<glyph glyph-name="dollar" unicode="$"
|
||||
/>
|
||||
<glyph glyph-name="percent" unicode="%"
|
||||
/>
|
||||
<glyph glyph-name="ampersand" unicode="&"
|
||||
/>
|
||||
<glyph glyph-name="quotesingle" unicode="'"
|
||||
/>
|
||||
<glyph glyph-name="parenleft" unicode="("
|
||||
/>
|
||||
<glyph glyph-name="parenright" unicode=")"
|
||||
/>
|
||||
<glyph glyph-name="asterisk" unicode="*"
|
||||
/>
|
||||
<glyph glyph-name="plus" unicode="+"
|
||||
/>
|
||||
<glyph glyph-name="comma" unicode=","
|
||||
/>
|
||||
<glyph glyph-name="hyphen" unicode="-" horiz-adv-x="1223"
|
||||
d="M208 873h979v-294h-979v294z" />
|
||||
<glyph glyph-name="hyphen" unicode="­" horiz-adv-x="1223"
|
||||
d="M208 873h979v-294h-979v294z" />
|
||||
<glyph glyph-name="period" unicode="."
|
||||
/>
|
||||
<glyph glyph-name="slash" unicode="/"
|
||||
/>
|
||||
<glyph glyph-name="zero" unicode="0" horiz-adv-x="2046"
|
||||
d="M1925 717q0 -186 -62 -321.5t-178.5 -223t-283 -130t-378.5 -42.5t-378.5 42.5t-282.5 130t-178.5 223t-62.5 321.5t62.5 321.5t178.5 223t282.5 130t378.5 42.5t378.5 -42.5t283 -130t178.5 -223t62 -321.5zM1023 303q444 0 444 414t-444 414t-444 -414t444 -414z" />
|
||||
<glyph glyph-name="one" unicode="1" horiz-adv-x="910"
|
||||
d="M785 1434v-1434h-459v1134h-207v300h666z" />
|
||||
<glyph glyph-name="two" unicode="2" horiz-adv-x="1843"
|
||||
d="M122 0v435q0 209 128 320.5t370 111.5h484q161 0 161 135q0 132 -161 132h-942v300h1063q239 0 368.5 -111.5t129.5 -320.5t-131 -320.5t-381 -111.5h-473q-158 0 -158 -135v-138h1103v-297h-1561z" />
|
||||
<glyph glyph-name="three" unicode="3" horiz-adv-x="1789"
|
||||
d="M120 1434h1049q239 0 368.5 -111.5t129.5 -320.5q0 -197 -194 -284q194 -77 194 -286t-129.5 -320.5t-368.5 -111.5h-1049v300h928q161 0 161 132q0 138 -161 138h-828v297h828q161 0 161 135q0 132 -161 132h-928v300z" />
|
||||
<glyph glyph-name="four" unicode="4" horiz-adv-x="2017"
|
||||
d="M1213 0v254h-1091v300l907 880h642v-880h227v-300h-227v-254h-458zM1213 1183l-625 -629h625v629z" />
|
||||
<glyph glyph-name="five" unicode="5" horiz-adv-x="1816"
|
||||
d="M124 1434h1531v-300h-1073v-267h615q242 0 370 -111.5t128 -320.5q0 -212 -128 -323.5t-370 -111.5h-1073v297h955q158 0 158 138q0 135 -158 135h-955v864z" />
|
||||
<glyph glyph-name="six" unicode="6" horiz-adv-x="1848"
|
||||
d="M1024 0q-483 0 -692.5 180.5t-209.5 536.5t209.5 536.5t622.5 180.5h649v-297h-591q-215 0 -310.5 -66t-112.5 -198h641q242 0 370 -124.5t128 -313.5q0 -192 -153 -313.5t-551 -121.5zM589 579q7 -129 102.5 -204t320.5 -75q258 0 258 144q0 135 -158 135h-523z" />
|
||||
<glyph glyph-name="seven" unicode="7" horiz-adv-x="1811"
|
||||
d="M1170 1134h-1051v300h1573v-300l-757 -1134h-522z" />
|
||||
<glyph glyph-name="eight" unicode="8" horiz-adv-x="1816"
|
||||
d="M759 1134q-161 0 -161 -132q0 -135 161 -135h299q161 0 161 135q0 132 -161 132h-299zM1078 300q161 0 161 132q0 138 -161 138h-339q-161 0 -161 -138q0 -132 161 -132h339zM1179 1434q239 0 363.5 -111.5t124.5 -320.5q0 -187 -234 -284q264 -87 264 -326
|
||||
q0 -169 -129.5 -280.5t-368.5 -111.5h-581q-239 0 -368.5 111.5t-129.5 280.5q0 239 264 326q-234 97 -234 284q0 209 124.5 320.5t363.5 111.5h541z" />
|
||||
<glyph glyph-name="nine" unicode="9" horiz-adv-x="1847"
|
||||
d="M914 1434q423 0 617.5 -180.5t194.5 -536.5t-209.5 -536.5t-622.5 -180.5h-649v297h591q215 0 310.5 66t112.5 198h-641q-242 0 -370 109.5t-128 298.5q0 192 188 328.5t606 136.5zM1259 855q-7 129 -87.5 204t-285.5 75q-308 0 -308 -154q0 -125 158 -125h523z" />
|
||||
<glyph glyph-name="colon" unicode=":"
|
||||
/>
|
||||
<glyph glyph-name="semicolon" unicode=";"
|
||||
/>
|
||||
<glyph glyph-name="semicolon" unicode=";"
|
||||
/>
|
||||
<glyph glyph-name="less" unicode="<"
|
||||
/>
|
||||
<glyph glyph-name="equal" unicode="="
|
||||
/>
|
||||
<glyph glyph-name="greater" unicode=">"
|
||||
/>
|
||||
<glyph glyph-name="question" unicode="?"
|
||||
/>
|
||||
<glyph glyph-name="at" unicode="@"
|
||||
/>
|
||||
<glyph glyph-name="A" unicode="A" horiz-adv-x="1845"
|
||||
d="M630 0q-253 0 -390 117.5t-137 325.5q0 207 137 324.5t390 117.5h636v52q0 109 -51.5 153t-177.5 44h-825v300h842q355 0 512.5 -135t157.5 -441v-858h-1094zM1266 591h-513q-185 0 -185 -148q0 -149 185 -149h513v297z" />
|
||||
<glyph glyph-name="B" unicode="B" horiz-adv-x="1755"
|
||||
d="M581 579v-279h414q196 0 196 139q0 140 -196 140h-414zM1140 1434q205 0 323 -95t118 -285q0 -95 -28 -154.5t-65.5 -94t-75 -49.5t-57.5 -20q39 -6 89.5 -25.5t96 -61.5t77 -107t31.5 -162q0 -184 -125 -282t-338 -98h-1063v1434h1017zM934 873q96 0 142.5 31t46.5 101
|
||||
q0 69 -46.5 100.5t-142.5 31.5h-353v-264h353z" />
|
||||
<glyph glyph-name="C" unicode="C" horiz-adv-x="1704"
|
||||
d="M1586 1131h-549q-250 0 -362 -97t-112 -317t110 -317t361 -97h552v-303h-666q-404 0 -609 180.5t-205 536.5q0 355 205 536t609 181h666v-303z" />
|
||||
<glyph glyph-name="D" unicode="D" horiz-adv-x="1845"
|
||||
d="M581 1131v-828h224q251 0 366 97t115 317t-117 317t-367 97h-221zM919 1434q404 0 609 -181t205 -536q0 -356 -205 -536.5t-609 -180.5h-796v1434h796z" />
|
||||
<glyph glyph-name="E" unicode="E" horiz-adv-x="1714"
|
||||
d="M1587 1137h-591q-215 0 -310.5 -66t-112.5 -198h1014v-294h-1014q7 -129 102.5 -204t320.5 -75h591v-300h-649q-413 0 -622.5 180.5t-209.5 536.5t209.5 536.5t622.5 180.5h649v-297z" />
|
||||
<glyph glyph-name="F" unicode="F" horiz-adv-x="1721"
|
||||
d="M116 717q0 356 209.5 536.5t622.5 180.5h649v-297h-591q-215 0 -310.5 -66t-112.5 -198h1014v-294h-1023v-579h-458v717z" />
|
||||
<glyph glyph-name="G" unicode="G" horiz-adv-x="1813"
|
||||
d="M1686 854v-854h-766q-404 0 -609 180.5t-205 536.5q0 355 205 536t609 181h766v-293h-649q-250 0 -362 -97t-112 -327q0 -220 110 -317t361 -97h194v267h-296v284h754z" />
|
||||
<glyph glyph-name="H" unicode="H" horiz-adv-x="1908"
|
||||
d="M581 567v-567h-458v1434h458v-567h742v567h458v-1434h-458v567h-742z" />
|
||||
<glyph glyph-name="I" unicode="I" horiz-adv-x="708"
|
||||
d="M581 1434v-1434h-458v1434h458z" />
|
||||
<glyph glyph-name="J" unicode="J" horiz-adv-x="1410"
|
||||
d="M1288 1434v-717q0 -356 -205 -536.5t-609 -180.5h-366v303h252q251 0 361 97t110 317v717h457z" />
|
||||
<glyph glyph-name="K" unicode="K" horiz-adv-x="1871"
|
||||
d="M1721 1434l-693 -641l754 -793h-546l-655 696v-696h-458v1434h458v-585l607 585h533z" />
|
||||
<glyph glyph-name="L" unicode="L" horiz-adv-x="1807"
|
||||
d="M575 1434v-917q0 -214 251 -214h872v-303h-986q-594 0 -594 517v917h457z" />
|
||||
<glyph glyph-name="M" unicode="M" horiz-adv-x="2408"
|
||||
d="M1831 0v858q0 144 -72 205.5t-239 61.5h-95v-1125h-458v1125h-386v-1125h-458v1434h1475q362 0 526 -141t164 -453v-840h-457z" />
|
||||
<glyph glyph-name="N" unicode="N" horiz-adv-x="1853"
|
||||
d="M1109 1434q292 0 458 -141t166 -453v-840h-458v843q0 150 -77 216t-201 66h-416v-1125h-458v1434h986z" />
|
||||
<glyph glyph-name="O" unicode="O" horiz-adv-x="2022"
|
||||
d="M1910 717q0 -186 -62 -321.5t-178.5 -223t-283 -130t-378.5 -42.5t-378.5 42.5t-282.5 130t-178.5 223t-62.5 321.5t62.5 321.5t178.5 223t282.5 130t378.5 42.5t378.5 -42.5t283 -130t178.5 -223t62 -321.5zM1008 303q444 0 444 414t-444 414t-444 -414t444 -414z" />
|
||||
<glyph glyph-name="P" unicode="P" horiz-adv-x="1800"
|
||||
d="M123 0v1434h945q321 0 471.5 -127.5t150.5 -348.5q0 -218 -149 -345.5t-473 -127.5h-487v-485h-458zM1208 957q0 180 -221 180h-406v-358h406q221 0 221 178z" />
|
||||
<glyph glyph-name="Q" unicode="Q" horiz-adv-x="2028"
|
||||
d="M1008 303q444 0 444 414t-444 414t-444 -414t444 -414zM1008 0q-212 0 -378.5 42.5t-282.5 130t-178.5 223t-62.5 321.5t62.5 321.5t178.5 223t282.5 130t378.5 42.5t378.5 -42.5t283 -130t178.5 -223t62 -321.5q0 -256 -197 -417h197v-300h-902z" />
|
||||
<glyph glyph-name="R" unicode="R" horiz-adv-x="1881"
|
||||
d="M1268 940q0 197 -221 197h-466v-398h466q221 0 221 201zM926 445h-345v-445h-458v1434h1035q301 0 446.5 -137.5t145.5 -355.5q0 -221 -144 -358q-73 -70 -186 -104l363 -479h-537z" />
|
||||
<glyph glyph-name="S" unicode="S" horiz-adv-x="1817"
|
||||
d="M145 0v297h945q158 0 158 138q0 135 -158 135h-473q-249 0 -380.5 111.5t-131.5 320.5t129.5 320.5t368.5 111.5h1063v-300h-941q-162 0 -162 -132q0 -135 162 -135h483q243 0 370.5 -111.5t127.5 -320.5q0 -212 -127.5 -323.5t-370.5 -111.5h-1063z" />
|
||||
<glyph glyph-name="T" unicode="T" horiz-adv-x="1789"
|
||||
d="M662 1134h-557v300h1573v-300h-557v-1134h-459v1134z" />
|
||||
<glyph glyph-name="U" unicode="U" horiz-adv-x="1825"
|
||||
d="M742 0q-292 0 -458 141t-166 453v840h458v-843q0 -150 77 -216t201 -66h386v1125h458v-1434h-956z" />
|
||||
<glyph glyph-name="V" unicode="V" horiz-adv-x="2073"
|
||||
d="M777 0l-683 1434h479l468 -1017l468 1017h468l-683 -1434h-517z" />
|
||||
<glyph glyph-name="W" unicode="W" horiz-adv-x="2916"
|
||||
d="M1785 0l-329 976l-330 -976h-503l-529 1434h473l339 -981l311 981h502l315 -981l335 981h449l-530 -1434h-503z" />
|
||||
<glyph glyph-name="X" unicode="X" horiz-adv-x="1984"
|
||||
d="M1270 726l621 -726h-532l-373 467l-376 -467h-519l623 717l-606 717h516l373 -463l379 463h498z" />
|
||||
<glyph glyph-name="Y" unicode="Y" horiz-adv-x="1993"
|
||||
d="M766 462l-674 972h516l394 -637l398 637h498l-674 -972v-462h-458v462z" />
|
||||
<glyph glyph-name="Z" unicode="Z" horiz-adv-x="1706"
|
||||
d="M1589 1434v-300l-864 -834h864v-300h-1473v300l864 834h-864v300h1473z" />
|
||||
<glyph glyph-name="bracketleft" unicode="["
|
||||
/>
|
||||
<glyph glyph-name="backslash" unicode="\"
|
||||
/>
|
||||
<glyph glyph-name="bracketright" unicode="]"
|
||||
/>
|
||||
<glyph glyph-name="asciicircum" unicode="^"
|
||||
/>
|
||||
<glyph glyph-name="underscore" unicode="_"
|
||||
/>
|
||||
<glyph glyph-name="grave" unicode="`"
|
||||
/>
|
||||
<glyph glyph-name="a" unicode="a" horiz-adv-x="1845"
|
||||
d="M630 0q-253 0 -390 117.5t-137 325.5q0 207 137 324.5t390 117.5h636v52q0 109 -51.5 153t-177.5 44h-825v300h842q355 0 512.5 -135t157.5 -441v-858h-1094zM1266 591h-513q-185 0 -185 -148q0 -149 185 -149h513v297z" />
|
||||
<glyph glyph-name="b" unicode="b" horiz-adv-x="1755"
|
||||
d="M581 579v-279h414q196 0 196 139q0 140 -196 140h-414zM1140 1434q205 0 323 -95t118 -285q0 -95 -28 -154.5t-65.5 -94t-75 -49.5t-57.5 -20q39 -6 89.5 -25.5t96 -61.5t77 -107t31.5 -162q0 -184 -125 -282t-338 -98h-1063v1434h1017zM934 873q96 0 142.5 31t46.5 101
|
||||
q0 69 -46.5 100.5t-142.5 31.5h-353v-264h353z" />
|
||||
<glyph glyph-name="c" unicode="c" horiz-adv-x="1704"
|
||||
d="M1586 1131h-549q-250 0 -362 -97t-112 -317t110 -317t361 -97h552v-303h-666q-404 0 -609 180.5t-205 536.5q0 355 205 536t609 181h666v-303z" />
|
||||
<glyph glyph-name="d" unicode="d" horiz-adv-x="1845"
|
||||
d="M581 1131v-828h224q251 0 366 97t115 317t-117 317t-367 97h-221zM919 1434q404 0 609 -181t205 -536q0 -356 -205 -536.5t-609 -180.5h-796v1434h796z" />
|
||||
<glyph glyph-name="e" unicode="e" horiz-adv-x="1714"
|
||||
d="M1587 1137h-591q-215 0 -310.5 -66t-112.5 -198h1014v-294h-1014q7 -129 102.5 -204t320.5 -75h591v-300h-649q-413 0 -622.5 180.5t-209.5 536.5t209.5 536.5t622.5 180.5h649v-297z" />
|
||||
<glyph glyph-name="f" unicode="f" horiz-adv-x="1721"
|
||||
d="M116 717q0 356 209.5 536.5t622.5 180.5h649v-297h-591q-215 0 -310.5 -66t-112.5 -198h1014v-294h-1023v-579h-458v717z" />
|
||||
<glyph glyph-name="g" unicode="g" horiz-adv-x="1813"
|
||||
d="M1686 854v-854h-766q-404 0 -609 180.5t-205 536.5q0 355 205 536t609 181h766v-293h-649q-250 0 -362 -97t-112 -327q0 -220 110 -317t361 -97h194v267h-296v284h754z" />
|
||||
<glyph glyph-name="h" unicode="h" horiz-adv-x="1908"
|
||||
d="M581 567v-567h-458v1434h458v-567h742v567h458v-1434h-458v567h-742z" />
|
||||
<glyph glyph-name="i" unicode="i" horiz-adv-x="708"
|
||||
d="M581 1434v-1434h-458v1434h458z" />
|
||||
<glyph glyph-name="j" unicode="j" horiz-adv-x="1410"
|
||||
d="M1288 1434v-717q0 -356 -205 -536.5t-609 -180.5h-366v303h252q251 0 361 97t110 317v717h457z" />
|
||||
<glyph glyph-name="k" unicode="k" horiz-adv-x="1871"
|
||||
d="M1721 1434l-693 -641l754 -793h-546l-655 696v-696h-458v1434h458v-585l607 585h533z" />
|
||||
<glyph glyph-name="l" unicode="l" horiz-adv-x="1807"
|
||||
d="M575 1434v-917q0 -214 251 -214h872v-303h-986q-594 0 -594 517v917h457z" />
|
||||
<glyph glyph-name="m" unicode="m" horiz-adv-x="2408"
|
||||
d="M1831 0v858q0 144 -72 205.5t-239 61.5h-95v-1125h-458v1125h-386v-1125h-458v1434h1475q362 0 526 -141t164 -453v-840h-457z" />
|
||||
<glyph glyph-name="n" unicode="n" horiz-adv-x="1853"
|
||||
d="M1109 1434q292 0 458 -141t166 -453v-840h-458v843q0 150 -77 216t-201 66h-416v-1125h-458v1434h986z" />
|
||||
<glyph glyph-name="o" unicode="o" horiz-adv-x="2022"
|
||||
d="M1910 717q0 -186 -62 -321.5t-178.5 -223t-283 -130t-378.5 -42.5t-378.5 42.5t-282.5 130t-178.5 223t-62.5 321.5t62.5 321.5t178.5 223t282.5 130t378.5 42.5t378.5 -42.5t283 -130t178.5 -223t62 -321.5zM1008 303q444 0 444 414t-444 414t-444 -414t444 -414z" />
|
||||
<glyph glyph-name="p" unicode="p" horiz-adv-x="1800"
|
||||
d="M123 0v1434h945q321 0 471.5 -127.5t150.5 -348.5q0 -218 -149 -345.5t-473 -127.5h-487v-485h-458zM1208 957q0 180 -221 180h-406v-358h406q221 0 221 178z" />
|
||||
<glyph glyph-name="q" unicode="q" horiz-adv-x="2028"
|
||||
d="M1008 303q444 0 444 414t-444 414t-444 -414t444 -414zM1008 0q-212 0 -378.5 42.5t-282.5 130t-178.5 223t-62.5 321.5t62.5 321.5t178.5 223t282.5 130t378.5 42.5t378.5 -42.5t283 -130t178.5 -223t62 -321.5q0 -256 -197 -417h197v-300h-902z" />
|
||||
<glyph glyph-name="r" unicode="r" horiz-adv-x="1881"
|
||||
d="M1268 940q0 197 -221 197h-466v-398h466q221 0 221 201zM926 445h-345v-445h-458v1434h1035q301 0 446.5 -137.5t145.5 -355.5q0 -221 -144 -358q-73 -70 -186 -104l363 -479h-537z" />
|
||||
<glyph glyph-name="s" unicode="s" horiz-adv-x="1817"
|
||||
d="M145 0v297h945q158 0 158 138q0 135 -158 135h-473q-249 0 -380.5 111.5t-131.5 320.5t129.5 320.5t368.5 111.5h1063v-300h-941q-162 0 -162 -132q0 -135 162 -135h483q243 0 370.5 -111.5t127.5 -320.5q0 -212 -127.5 -323.5t-370.5 -111.5h-1063z" />
|
||||
<glyph glyph-name="t" unicode="t" horiz-adv-x="1789"
|
||||
d="M662 1134h-557v300h1573v-300h-557v-1134h-459v1134z" />
|
||||
<glyph glyph-name="u" unicode="u" horiz-adv-x="1825"
|
||||
d="M742 0q-292 0 -458 141t-166 453v840h458v-843q0 -150 77 -216t201 -66h386v1125h458v-1434h-956z" />
|
||||
<glyph glyph-name="v" unicode="v" horiz-adv-x="2073"
|
||||
d="M777 0l-683 1434h479l468 -1017l468 1017h468l-683 -1434h-517z" />
|
||||
<glyph glyph-name="w" unicode="w" horiz-adv-x="2916"
|
||||
d="M1785 0l-329 976l-330 -976h-503l-529 1434h473l339 -981l311 981h502l315 -981l335 981h449l-530 -1434h-503z" />
|
||||
<glyph glyph-name="x" unicode="x" horiz-adv-x="1984"
|
||||
d="M1270 726l621 -726h-532l-373 467l-376 -467h-519l623 717l-606 717h516l373 -463l379 463h498z" />
|
||||
<glyph glyph-name="y" unicode="y" horiz-adv-x="1993"
|
||||
d="M766 462l-674 972h516l394 -637l398 637h498l-674 -972v-462h-458v462z" />
|
||||
<glyph glyph-name="z" unicode="z" horiz-adv-x="1706"
|
||||
d="M1589 1434v-300l-864 -834h864v-300h-1473v300l864 834h-864v300h1473z" />
|
||||
<glyph glyph-name="braceleft" unicode="{"
|
||||
/>
|
||||
<glyph glyph-name="bar" unicode="|"
|
||||
/>
|
||||
<glyph glyph-name="braceright" unicode="}"
|
||||
/>
|
||||
<glyph glyph-name="asciitilde" unicode="~"
|
||||
/>
|
||||
<glyph glyph-name="exclamdown" unicode="¡"
|
||||
/>
|
||||
<glyph glyph-name="cent" unicode="¢"
|
||||
/>
|
||||
<glyph glyph-name="sterling" unicode="£"
|
||||
/>
|
||||
<glyph glyph-name="currency" unicode="¤"
|
||||
/>
|
||||
<glyph glyph-name="yen" unicode="¥"
|
||||
/>
|
||||
<glyph glyph-name="brokenbar" unicode="¦"
|
||||
/>
|
||||
<glyph glyph-name="section" unicode="§"
|
||||
/>
|
||||
<glyph glyph-name="dieresis" unicode="¨"
|
||||
/>
|
||||
<glyph glyph-name="copyright" unicode="©"
|
||||
/>
|
||||
<glyph glyph-name="ordfeminine" unicode="ª"
|
||||
/>
|
||||
<glyph glyph-name="guillemotleft" unicode="«"
|
||||
/>
|
||||
<glyph glyph-name="logicalnot" unicode="¬"
|
||||
/>
|
||||
<glyph glyph-name="registered" unicode="®"
|
||||
/>
|
||||
<glyph glyph-name="macron" unicode="¯"
|
||||
/>
|
||||
<glyph glyph-name="degree" unicode="°"
|
||||
/>
|
||||
<glyph glyph-name="plusminus" unicode="±"
|
||||
/>
|
||||
<glyph glyph-name="uni00B2" unicode="²"
|
||||
/>
|
||||
<glyph glyph-name="uni00B3" unicode="³"
|
||||
/>
|
||||
<glyph glyph-name="acute" unicode="´"
|
||||
/>
|
||||
<glyph glyph-name="mu" unicode="µ"
|
||||
/>
|
||||
<glyph glyph-name="paragraph" unicode="¶"
|
||||
/>
|
||||
<glyph glyph-name="periodcentered" unicode="·"
|
||||
/>
|
||||
<glyph glyph-name="periodcentered" unicode="∙"
|
||||
/>
|
||||
<glyph glyph-name="cedilla" unicode="¸"
|
||||
/>
|
||||
<glyph glyph-name="uni00B9" unicode="¹"
|
||||
/>
|
||||
<glyph glyph-name="ordmasculine" unicode="º"
|
||||
/>
|
||||
<glyph glyph-name="guillemotright" unicode="»"
|
||||
/>
|
||||
<glyph glyph-name="onequarter" unicode="¼"
|
||||
/>
|
||||
<glyph glyph-name="onehalf" unicode="½"
|
||||
/>
|
||||
<glyph glyph-name="threequarters" unicode="¾"
|
||||
/>
|
||||
<glyph glyph-name="questiondown" unicode="¿"
|
||||
/>
|
||||
<glyph glyph-name="Agrave" unicode="À" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Aacute" unicode="Á" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Acircumflex" unicode="Â" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Atilde" unicode="Ã" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Adieresis" unicode="Ä" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Aring" unicode="Å" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="AE" unicode="Æ" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Ccedilla" unicode="Ç" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Egrave" unicode="È" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Eacute" unicode="É" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Ecircumflex" unicode="Ê" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Edieresis" unicode="Ë" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Igrave" unicode="Ì" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Iacute" unicode="Í" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Icircumflex" unicode="Î" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Idieresis" unicode="Ï" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Eth" unicode="Ð" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Ntilde" unicode="Ñ" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Ograve" unicode="Ò" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Oacute" unicode="Ó" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Ocircumflex" unicode="Ô" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Otilde" unicode="Õ" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Odieresis" unicode="Ö" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="multiply" unicode="×" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Oslash" unicode="Ø" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Ugrave" unicode="Ù" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Uacute" unicode="Ú" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Ucircumflex" unicode="Û" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Udieresis" unicode="Ü" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Yacute" unicode="Ý" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="Thorn" unicode="Þ" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="germandbls" unicode="ß" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="agrave" unicode="à" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="aacute" unicode="á" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="acircumflex" unicode="â" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="atilde" unicode="ã" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="adieresis" unicode="ä" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="aring" unicode="å" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="ae" unicode="æ" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="ccedilla" unicode="ç" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="egrave" unicode="è" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="eacute" unicode="é" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="ecircumflex" unicode="ê" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="edieresis" unicode="ë" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="igrave" unicode="ì" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="iacute" unicode="í" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="icircumflex" unicode="î" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="idieresis" unicode="ï" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="eth" unicode="ð" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="ntilde" unicode="ñ" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="ograve" unicode="ò" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="oacute" unicode="ó" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="ocircumflex" unicode="ô" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="otilde" unicode="õ" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="odieresis" unicode="ö" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="divide" unicode="÷" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="oslash" unicode="ø" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="ugrave" unicode="ù" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="uacute" unicode="ú" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="ucircumflex" unicode="û" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="udieresis" unicode="ü" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="yacute" unicode="ý" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="thorn" unicode="þ" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="ydieresis" unicode="ÿ" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="dotlessi" unicode="ı" horiz-adv-x="266"
|
||||
/>
|
||||
<glyph glyph-name="circumflex" unicode="ˆ"
|
||||
/>
|
||||
<glyph glyph-name="caron" unicode="ˇ"
|
||||
/>
|
||||
<glyph glyph-name="uni02C9" unicode="ˉ"
|
||||
/>
|
||||
<glyph glyph-name="breve" unicode="˘"
|
||||
/>
|
||||
<glyph glyph-name="dotaccent" unicode="˙"
|
||||
/>
|
||||
<glyph glyph-name="ring" unicode="˚"
|
||||
/>
|
||||
<glyph glyph-name="ogonek" unicode="˛"
|
||||
/>
|
||||
<glyph glyph-name="tilde" unicode="˜"
|
||||
/>
|
||||
<glyph glyph-name="hungarumlaut" unicode="˝"
|
||||
/>
|
||||
<glyph glyph-name="endash" unicode="–"
|
||||
/>
|
||||
<glyph glyph-name="emdash" unicode="—"
|
||||
/>
|
||||
<glyph glyph-name="quoteleft" unicode="‘"
|
||||
/>
|
||||
<glyph glyph-name="quoteright" unicode="’"
|
||||
/>
|
||||
<glyph glyph-name="quotesinglbase" unicode="‚"
|
||||
/>
|
||||
<glyph glyph-name="quotedblleft" unicode="“"
|
||||
/>
|
||||
<glyph glyph-name="quotedblright" unicode="”"
|
||||
/>
|
||||
<glyph glyph-name="quotedblbase" unicode="„"
|
||||
/>
|
||||
<glyph glyph-name="dagger" unicode="†"
|
||||
/>
|
||||
<glyph glyph-name="daggerdbl" unicode="‡"
|
||||
/>
|
||||
<glyph glyph-name="bullet" unicode="•"
|
||||
/>
|
||||
<glyph glyph-name="ellipsis" unicode="…"
|
||||
/>
|
||||
<glyph glyph-name="guilsinglleft" unicode="‹"
|
||||
/>
|
||||
<glyph glyph-name="guilsinglright" unicode="›"
|
||||
/>
|
||||
<glyph glyph-name="fraction" unicode="⁄"
|
||||
/>
|
||||
<glyph glyph-name="fraction" unicode="∕"
|
||||
/>
|
||||
<glyph glyph-name="franc" unicode="₣"
|
||||
/>
|
||||
<glyph glyph-name="lira" unicode="₤"
|
||||
/>
|
||||
<glyph glyph-name="peseta" unicode="₧"
|
||||
/>
|
||||
<glyph glyph-name="Euro" unicode="€"
|
||||
/>
|
||||
<glyph glyph-name="afii61352" unicode="№"
|
||||
/>
|
||||
<glyph glyph-name="trademark" unicode="™"
|
||||
/>
|
||||
<glyph glyph-name="partialdiff" unicode="∂"
|
||||
/>
|
||||
<glyph glyph-name="Delta" unicode="∆"
|
||||
/>
|
||||
<glyph glyph-name="product" unicode="∏"
|
||||
/>
|
||||
<glyph glyph-name="summation" unicode="∑"
|
||||
/>
|
||||
<glyph glyph-name="minus" unicode="−"
|
||||
/>
|
||||
<glyph glyph-name="radical" unicode="√"
|
||||
/>
|
||||
<glyph glyph-name="infinity" unicode="∞"
|
||||
/>
|
||||
<glyph glyph-name="integral" unicode="∫"
|
||||
/>
|
||||
<glyph glyph-name="approxequal" unicode="≈"
|
||||
/>
|
||||
<glyph glyph-name="lessequal" unicode="≤"
|
||||
/>
|
||||
<glyph glyph-name="greaterequal" unicode="≥"
|
||||
/>
|
||||
<glyph glyph-name="uniF001" unicode=""
|
||||
/>
|
||||
<glyph glyph-name="uniF001" unicode="fi"
|
||||
/>
|
||||
<glyph glyph-name="uniF002" unicode=""
|
||||
/>
|
||||
<glyph glyph-name="uniF002" unicode="fl"
|
||||
/>
|
||||
</font>
|
||||
</defs></svg>
|
After Width: | Height: | Size: 24 KiB |
BIN
client/src/fonts/Super-FamiFont.ttf.woff
Normal file
BIN
client/src/fonts/Super-FamiFont.ttf.woff
Normal file
Binary file not shown.
14
client/src/index.css
Executable file
14
client/src/index.css
Executable file
|
@ -0,0 +1,14 @@
|
|||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
||||
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
||||
sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
||||
monospace;
|
||||
}
|
12
client/src/index.js
Executable file
12
client/src/index.js
Executable file
|
@ -0,0 +1,12 @@
|
|||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import './index.css';
|
||||
import App from './App';
|
||||
import * as serviceWorker from './serviceWorker';
|
||||
|
||||
ReactDOM.render(<App />, 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.
|
||||
// Learn more about service workers: http://bit.ly/CRA-PWA
|
||||
serviceWorker.unregister();
|
7
client/src/logo.svg
Executable file
7
client/src/logo.svg
Executable file
|
@ -0,0 +1,7 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 841.9 595.3">
|
||||
<g fill="#61DAFB">
|
||||
<path d="M666.3 296.5c0-32.5-40.7-63.3-103.1-82.4 14.4-63.6 8-114.2-20.2-130.4-6.5-3.8-14.1-5.6-22.4-5.6v22.3c4.6 0 8.3.9 11.4 2.6 13.6 7.8 19.5 37.5 14.9 75.7-1.1 9.4-2.9 19.3-5.1 29.4-19.6-4.8-41-8.5-63.5-10.9-13.5-18.5-27.5-35.3-41.6-50 32.6-30.3 63.2-46.9 84-46.9V78c-27.5 0-63.5 19.6-99.9 53.6-36.4-33.8-72.4-53.2-99.9-53.2v22.3c20.7 0 51.4 16.5 84 46.6-14 14.7-28 31.4-41.3 49.9-22.6 2.4-44 6.1-63.6 11-2.3-10-4-19.7-5.2-29-4.7-38.2 1.1-67.9 14.6-75.8 3-1.8 6.9-2.6 11.5-2.6V78.5c-8.4 0-16 1.8-22.6 5.6-28.1 16.2-34.4 66.7-19.9 130.1-62.2 19.2-102.7 49.9-102.7 82.3 0 32.5 40.7 63.3 103.1 82.4-14.4 63.6-8 114.2 20.2 130.4 6.5 3.8 14.1 5.6 22.5 5.6 27.5 0 63.5-19.6 99.9-53.6 36.4 33.8 72.4 53.2 99.9 53.2 8.4 0 16-1.8 22.6-5.6 28.1-16.2 34.4-66.7 19.9-130.1 62-19.1 102.5-49.9 102.5-82.3zm-130.2-66.7c-3.7 12.9-8.3 26.2-13.5 39.5-4.1-8-8.4-16-13.1-24-4.6-8-9.5-15.8-14.4-23.4 14.2 2.1 27.9 4.7 41 7.9zm-45.8 106.5c-7.8 13.5-15.8 26.3-24.1 38.2-14.9 1.3-30 2-45.2 2-15.1 0-30.2-.7-45-1.9-8.3-11.9-16.4-24.6-24.2-38-7.6-13.1-14.5-26.4-20.8-39.8 6.2-13.4 13.2-26.8 20.7-39.9 7.8-13.5 15.8-26.3 24.1-38.2 14.9-1.3 30-2 45.2-2 15.1 0 30.2.7 45 1.9 8.3 11.9 16.4 24.6 24.2 38 7.6 13.1 14.5 26.4 20.8 39.8-6.3 13.4-13.2 26.8-20.7 39.9zm32.3-13c5.4 13.4 10 26.8 13.8 39.8-13.1 3.2-26.9 5.9-41.2 8 4.9-7.7 9.8-15.6 14.4-23.7 4.6-8 8.9-16.1 13-24.1zM421.2 430c-9.3-9.6-18.6-20.3-27.8-32 9 .4 18.2.7 27.5.7 9.4 0 18.7-.2 27.8-.7-9 11.7-18.3 22.4-27.5 32zm-74.4-58.9c-14.2-2.1-27.9-4.7-41-7.9 3.7-12.9 8.3-26.2 13.5-39.5 4.1 8 8.4 16 13.1 24 4.7 8 9.5 15.8 14.4 23.4zM420.7 163c9.3 9.6 18.6 20.3 27.8 32-9-.4-18.2-.7-27.5-.7-9.4 0-18.7.2-27.8.7 9-11.7 18.3-22.4 27.5-32zm-74 58.9c-4.9 7.7-9.8 15.6-14.4 23.7-4.6 8-8.9 16-13 24-5.4-13.4-10-26.8-13.8-39.8 13.1-3.1 26.9-5.8 41.2-7.9zm-90.5 125.2c-35.4-15.1-58.3-34.9-58.3-50.6 0-15.7 22.9-35.6 58.3-50.6 8.6-3.7 18-7 27.7-10.1 5.7 19.6 13.2 40 22.5 60.9-9.2 20.8-16.6 41.1-22.2 60.6-9.9-3.1-19.3-6.5-28-10.2zM310 490c-13.6-7.8-19.5-37.5-14.9-75.7 1.1-9.4 2.9-19.3 5.1-29.4 19.6 4.8 41 8.5 63.5 10.9 13.5 18.5 27.5 35.3 41.6 50-32.6 30.3-63.2 46.9-84 46.9-4.5-.1-8.3-1-11.3-2.7zm237.2-76.2c4.7 38.2-1.1 67.9-14.6 75.8-3 1.8-6.9 2.6-11.5 2.6-20.7 0-51.4-16.5-84-46.6 14-14.7 28-31.4 41.3-49.9 22.6-2.4 44-6.1 63.6-11 2.3 10.1 4.1 19.8 5.2 29.1zm38.5-66.7c-8.6 3.7-18 7-27.7 10.1-5.7-19.6-13.2-40-22.5-60.9 9.2-20.8 16.6-41.1 22.2-60.6 9.9 3.1 19.3 6.5 28.1 10.2 35.4 15.1 58.3 34.9 58.3 50.6-.1 15.7-23 35.6-58.4 50.6zM320.8 78.4z"/>
|
||||
<circle cx="420.9" cy="296.5" r="45.7"/>
|
||||
<path d="M520.5 78.1z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.6 KiB |
15
client/src/pages/ConfigPage/ConfigPage.js
Normal file
15
client/src/pages/ConfigPage/ConfigPage.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import React, { Component } from 'react';
|
||||
import { AppConfig } from '../../components';
|
||||
|
||||
class ConfigPage extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<AppConfig />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default ConfigPage;
|
15
client/src/pages/ControlsPage/ControlsPage.js
Normal file
15
client/src/pages/ControlsPage/ControlsPage.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
import React, { Component } from 'react';
|
||||
import { TotoObjectControls } from '../../components';
|
||||
|
||||
class ControlsPage extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<TotoObjectControls />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default ControlsPage;
|
17
client/src/pages/FilesPage/FilesPage.js
Normal file
17
client/src/pages/FilesPage/FilesPage.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
import React, { Component } from 'react';
|
||||
import { FileList, FileUpload } from '../../components';
|
||||
|
||||
class FilesPage extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<FileUpload />
|
||||
<br/>
|
||||
<FileList />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export default FilesPage;
|
16
client/src/pages/ScoreboardPage/ScoreboardPage.js
Normal file
16
client/src/pages/ScoreboardPage/ScoreboardPage.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import React, { Component } from 'react';
|
||||
import { PostLabourIndex } from '../../components';
|
||||
|
||||
class ScoreboardPage extends Component {
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<PostLabourIndex />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default ScoreboardPage;
|
11
client/src/pages/index.js
Normal file
11
client/src/pages/index.js
Normal file
|
@ -0,0 +1,11 @@
|
|||
import ConfigPage from './ConfigPage/ConfigPage';
|
||||
import ControlsPage from './ControlsPage/ControlsPage';
|
||||
import FilesPage from './FilesPage/FilesPage';
|
||||
import ScoreboardPage from './ScoreboardPage/ScoreboardPage';
|
||||
|
||||
export {
|
||||
ConfigPage,
|
||||
ControlsPage,
|
||||
FilesPage,
|
||||
ScoreboardPage
|
||||
};
|
137
client/src/reducers/appData.js
Normal file
137
client/src/reducers/appData.js
Normal file
|
@ -0,0 +1,137 @@
|
|||
import {
|
||||
CONFIG_LOADED,
|
||||
CONFIG_LOAD_ERROR,
|
||||
CONFIG_UPDATED,
|
||||
CONFIG_SAVED,
|
||||
OBJECT_STARTED,
|
||||
OBJECT_PAUSED,
|
||||
OBJECT_STOPPED,
|
||||
OBJECT_STATUS_LOADED,
|
||||
FILE_UPLOADED,
|
||||
FILES_LOADED,
|
||||
FILE_DELETED,
|
||||
PARAMS_LOADED,
|
||||
PARAMS_LOAD_ERROR,
|
||||
PLAYERS_LOADED,
|
||||
PLAYERS_LOAD_ERROR
|
||||
} from '../actions/types';
|
||||
|
||||
const initialState = {
|
||||
config: undefined,
|
||||
params: [],
|
||||
files: [],
|
||||
players: []
|
||||
};
|
||||
|
||||
export default function (state = initialState, action) {
|
||||
|
||||
switch (action.type) {
|
||||
case CONFIG_LOADED: {
|
||||
return {
|
||||
...state,
|
||||
config: action.config
|
||||
}
|
||||
}
|
||||
case CONFIG_UPDATED: {
|
||||
return {
|
||||
...state,
|
||||
config: action.config
|
||||
}
|
||||
}
|
||||
case CONFIG_SAVED: {
|
||||
return {
|
||||
...state,
|
||||
config: action.config
|
||||
}
|
||||
}
|
||||
case CONFIG_LOAD_ERROR: {
|
||||
return {
|
||||
...state,
|
||||
configLoadError: action.error
|
||||
}
|
||||
}
|
||||
case OBJECT_STARTED: {
|
||||
return {
|
||||
...state,
|
||||
status: action.status
|
||||
}
|
||||
}
|
||||
case OBJECT_PAUSED: {
|
||||
return {
|
||||
...state,
|
||||
status: action.status
|
||||
}
|
||||
}
|
||||
case OBJECT_STOPPED: {
|
||||
return {
|
||||
...state,
|
||||
status: action.status
|
||||
}
|
||||
}
|
||||
case OBJECT_STATUS_LOADED: {
|
||||
return {
|
||||
...state,
|
||||
status: action.status
|
||||
};
|
||||
}
|
||||
case FILE_UPLOADED: {
|
||||
let files = JSON.parse(JSON.stringify(state.files));
|
||||
files.push({
|
||||
key: action.file.name,
|
||||
name: action.file.name
|
||||
});
|
||||
return {
|
||||
...state,
|
||||
files: files
|
||||
};
|
||||
}
|
||||
case FILES_LOADED: {
|
||||
let files = action.files.map((file) => {
|
||||
return {
|
||||
key: file.name,
|
||||
name: file.name
|
||||
}
|
||||
});
|
||||
return {
|
||||
...state,
|
||||
files: files
|
||||
};
|
||||
}
|
||||
case FILE_DELETED: {
|
||||
let files = state.files.filter((file) => {
|
||||
return file.name !== action.fileName
|
||||
});
|
||||
return {
|
||||
...state,
|
||||
files: files
|
||||
};
|
||||
}
|
||||
case PLAYERS_LOADED: {
|
||||
return {
|
||||
...state,
|
||||
players: action.players
|
||||
};
|
||||
}
|
||||
case PLAYERS_LOAD_ERROR: {
|
||||
return {
|
||||
...state,
|
||||
players: [],
|
||||
playersLoadError: action.error
|
||||
};
|
||||
}
|
||||
case PARAMS_LOADED: {
|
||||
return {
|
||||
...state,
|
||||
params: action.params
|
||||
};
|
||||
}
|
||||
case PARAMS_LOAD_ERROR: {
|
||||
return {
|
||||
...state,
|
||||
paramsLoadError: action.error
|
||||
}
|
||||
}
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
7
client/src/reducers/index.js
Normal file
7
client/src/reducers/index.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { combineReducers } from 'redux';
|
||||
import appData from './appData';
|
||||
|
||||
|
||||
export default combineReducers({
|
||||
appData
|
||||
});
|
135
client/src/serviceWorker.js
Executable file
135
client/src/serviceWorker.js
Executable file
|
@ -0,0 +1,135 @@
|
|||
// This optional code is used to register a service worker.
|
||||
// register() is not called by default.
|
||||
|
||||
// This lets the app load faster on subsequent visits in production, and gives
|
||||
// it offline capabilities. However, it also means that developers (and users)
|
||||
// will only see deployed updates on subsequent visits to a page, after all the
|
||||
// existing tabs open on the page have been closed, since previously cached
|
||||
// resources are updated in the background.
|
||||
|
||||
// To learn more about the benefits of this model and instructions on how to
|
||||
// opt-in, read http://bit.ly/CRA-PWA
|
||||
|
||||
const isLocalhost = Boolean(
|
||||
window.location.hostname === 'localhost' ||
|
||||
// [::1] is the IPv6 localhost address.
|
||||
window.location.hostname === '[::1]' ||
|
||||
// 127.0.0.1/8 is considered localhost for IPv4.
|
||||
window.location.hostname.match(
|
||||
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
|
||||
)
|
||||
);
|
||||
|
||||
export function register(config) {
|
||||
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
||||
// The URL constructor is available in all browsers that support SW.
|
||||
const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);
|
||||
if (publicUrl.origin !== window.location.origin) {
|
||||
// Our service worker won't work if PUBLIC_URL is on a different origin
|
||||
// from what our page is served on. This might happen if a CDN is used to
|
||||
// serve assets; see https://github.com/facebook/create-react-app/issues/2374
|
||||
return;
|
||||
}
|
||||
|
||||
window.addEventListener('load', () => {
|
||||
const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
|
||||
|
||||
if (isLocalhost) {
|
||||
// This is running on localhost. Let's check if a service worker still exists or not.
|
||||
checkValidServiceWorker(swUrl, config);
|
||||
|
||||
// Add some additional logging to localhost, pointing developers to the
|
||||
// service worker/PWA documentation.
|
||||
navigator.serviceWorker.ready.then(() => {
|
||||
console.log(
|
||||
'This web app is being served cache-first by a service ' +
|
||||
'worker. To learn more, visit http://bit.ly/CRA-PWA'
|
||||
);
|
||||
});
|
||||
} else {
|
||||
// Is not localhost. Just register service worker
|
||||
registerValidSW(swUrl, config);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function registerValidSW(swUrl, config) {
|
||||
navigator.serviceWorker
|
||||
.register(swUrl)
|
||||
.then(registration => {
|
||||
registration.onupdatefound = () => {
|
||||
const installingWorker = registration.installing;
|
||||
if (installingWorker == null) {
|
||||
return;
|
||||
}
|
||||
installingWorker.onstatechange = () => {
|
||||
if (installingWorker.state === 'installed') {
|
||||
if (navigator.serviceWorker.controller) {
|
||||
// At this point, the updated precached content has been fetched,
|
||||
// but the previous service worker will still serve the older
|
||||
// content until all client tabs are closed.
|
||||
console.log(
|
||||
'New content is available and will be used when all ' +
|
||||
'tabs for this page are closed. See http://bit.ly/CRA-PWA.'
|
||||
);
|
||||
|
||||
// Execute callback
|
||||
if (config && config.onUpdate) {
|
||||
config.onUpdate(registration);
|
||||
}
|
||||
} else {
|
||||
// At this point, everything has been precached.
|
||||
// It's the perfect time to display a
|
||||
// "Content is cached for offline use." message.
|
||||
console.log('Content is cached for offline use.');
|
||||
|
||||
// Execute callback
|
||||
if (config && config.onSuccess) {
|
||||
config.onSuccess(registration);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during service worker registration:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function checkValidServiceWorker(swUrl, config) {
|
||||
// Check if the service worker can be found. If it can't reload the page.
|
||||
fetch(swUrl)
|
||||
.then(response => {
|
||||
// Ensure service worker exists, and that we really are getting a JS file.
|
||||
const contentType = response.headers.get('content-type');
|
||||
if (
|
||||
response.status === 404 ||
|
||||
(contentType != null && contentType.indexOf('javascript') === -1)
|
||||
) {
|
||||
// No service worker found. Probably a different app. Reload the page.
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
registration.unregister().then(() => {
|
||||
window.location.reload();
|
||||
});
|
||||
});
|
||||
} else {
|
||||
// Service worker found. Proceed as normal.
|
||||
registerValidSW(swUrl, config);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.log(
|
||||
'No internet connection found. App is running in offline mode.'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
export function unregister() {
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.ready.then(registration => {
|
||||
registration.unregister();
|
||||
});
|
||||
}
|
||||
}
|
114
client/src/services/ApiService.js
Normal file
114
client/src/services/ApiService.js
Normal file
|
@ -0,0 +1,114 @@
|
|||
class ApiService {
|
||||
|
||||
getConfig(onSuccess, onError) {
|
||||
this._get('/api/config', onSuccess, onError);
|
||||
};
|
||||
|
||||
udpateConfig(requestData, onSuccess, onError) {
|
||||
this._put('/api/config/update', requestData, onSuccess, onError);
|
||||
};
|
||||
|
||||
saveConfig(onSuccess, onError) {
|
||||
this._post('/api/config/save', {}, onSuccess, onError);
|
||||
};
|
||||
|
||||
startObject(onSuccess, onError) {
|
||||
this._post('/api/obj/start', {}, onSuccess, onError);
|
||||
};
|
||||
|
||||
pauseObject(onSuccess, onError) {
|
||||
this._post('/api/obj/pause', {}, onSuccess, onError);
|
||||
};
|
||||
|
||||
stopObject(onSuccess, onError) {
|
||||
this._post('/api/obj/stop', {}, onSuccess, onError);
|
||||
};
|
||||
|
||||
getObjectStatus(onSuccess, onError) {
|
||||
this._get('/api/obj/status', onSuccess, onError);
|
||||
};
|
||||
|
||||
getFiles(onSuccess, onError) {
|
||||
this._get('/api/files', onSuccess, onError);
|
||||
};
|
||||
|
||||
getParams(onSuccess, onError) {
|
||||
this._get('/api/nwap/params', onSuccess, onError);
|
||||
};
|
||||
|
||||
getPlayers(showId, onSuccess, onError) {
|
||||
this._get('/api/nwap/show/' + showId, onSuccess, onError);
|
||||
};
|
||||
|
||||
uploadFile(formData, onSuccess, onError) {
|
||||
fetch('/api/files', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(this._handleResponse(onSuccess, onError))
|
||||
.catch((error) => {
|
||||
onError({ error: error.message });
|
||||
});
|
||||
};
|
||||
|
||||
deleteFile(name, onSuccess, onError) {
|
||||
const url = '/api/files/' + name;
|
||||
fetch(url, { method: 'DELETE' })
|
||||
.then(this._handleResponse(onSuccess, onError))
|
||||
.catch((error) => {
|
||||
onError({ error: error.message });
|
||||
});
|
||||
}
|
||||
|
||||
_get(url, onSuccess, onError) {
|
||||
fetch(url)
|
||||
.then(this._handleResponse(onSuccess, onError))
|
||||
.catch((error) => {
|
||||
onError({ error: error.message });
|
||||
});
|
||||
};
|
||||
|
||||
_post(url, requestData, onSuccess, onError) {
|
||||
fetch(url, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(requestData)
|
||||
})
|
||||
.then(this._handleResponse(onSuccess, onError))
|
||||
.catch((error) => {
|
||||
onError(error);
|
||||
});
|
||||
};
|
||||
|
||||
_put(url, requestData, onSuccess, onError) {
|
||||
fetch(url, {
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify(requestData)
|
||||
}).then(this._handleResponse(onSuccess, onError))
|
||||
.catch((error) => {
|
||||
onError(error);
|
||||
})
|
||||
};
|
||||
|
||||
_handleResponse = (onSuccess, onError) => (response) => {
|
||||
if (response.status === 200) {
|
||||
response.json()
|
||||
.then(onSuccess)
|
||||
} else if (response.status === 400) {
|
||||
// JSON Syntax error
|
||||
response.json().then(onError)
|
||||
}
|
||||
else {
|
||||
onError({ "message": "Backend returned status: " + response.status })
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default ApiService;
|
23
client/src/store.js
Normal file
23
client/src/store.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { createStore, applyMiddleware, compose } from 'redux';
|
||||
import thunk from 'redux-thunk';
|
||||
import rootReducer from './reducers';
|
||||
|
||||
const initialState = {};
|
||||
|
||||
const middleware = [thunk];
|
||||
|
||||
let devTools = window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__();
|
||||
if (process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'production' || !devTools) {
|
||||
devTools = a => a;
|
||||
}
|
||||
|
||||
const store = createStore(
|
||||
rootReducer,
|
||||
initialState,
|
||||
compose(
|
||||
applyMiddleware(...middleware),
|
||||
devTools
|
||||
)
|
||||
);
|
||||
|
||||
export default store;
|
10982
client/yarn.lock
Executable file
10982
client/yarn.lock
Executable file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue