docs: Add to devlog

This commit is contained in:
2024-06-05 22:52:22 +02:00
parent 9c499d72e0
commit 7f300556cf
12 changed files with 151 additions and 136 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Roommapper</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>

View File

@@ -37,7 +37,8 @@ export default class ControlField extends React.Component {
body: JSON.stringify({ task: task })
})
.then(response => response.json())
.then(data => this.setState({ result: JSON.stringify(data) }))
.then(data => this.setState({
result: data.message ? data.message : JSON.stringify(data) }))
.catch(this.handleError);
}
@@ -45,9 +46,24 @@ export default class ControlField extends React.Component {
return (
<div className='control'>
<div className='control-buttons'>
<Button type='primary' onClick={() => this.handleClick(tasks.START)}>Start</Button>
<Button type='primary' onClick={() => this.handleClick(tasks.MAP)}>Map</Button>
<Button type='primary' danger onClick={() => this.handleClick(tasks.STOP)}>Stop</Button>
<Button
type='primary'
onClick={() => this.handleClick(tasks.START)}
>
Start
</Button>
<Button
type='primary'
onClick={() => this.handleClick(tasks.MAP)}
>
Map
</Button>
<Button
type='primary' danger
onClick={() => this.handleClick(tasks.STOP)}
>
Stop
</Button>
</div>
<Card
className='output-field'

View File

@@ -34,11 +34,16 @@ const App = () => {
}}
theme='dark'
>
<Menu theme="dark" mode="inline" defaultSelectedKeys={['map']} items={menuItems} />
<Menu
theme="dark"
mode="inline"
defaultSelectedKeys={['map']}
items={menuItems}
/>
</Sider>
<Layout
theme='dark'
style={{ marginLeft: 200 }}
theme='dark'
style={{ marginLeft: 200 }}
>
<Content
style={{ margin: '24px 16px 0', overflow: 'initial' }}

View File

@@ -33,7 +33,7 @@ export default class MapCanvas extends React.Component {
this.draw();
}
async getLinePoints(search = 'id', field = '8a97354d-d4ac-43c6-8b32-528cc24e3ede') {
async getLinePoints() {
try {
const { searchOption, inputValue } = this.state;
const url = `${API_ENDPOINT}/database?${searchOption}=${inputValue}`;

View File

@@ -16,7 +16,8 @@
}
.map-canvas {
border: 1px solid red;
border: 2px solid #008080;
border-radius: 4px;
}
.map-choice {