ADD: added tracklist and automated update

This commit is contained in:
hwinkel
2023-09-19 14:14:50 +02:00
parent b391c8e7ff
commit df41e5d9ea
10 changed files with 122 additions and 51 deletions

View File

@@ -0,0 +1,3 @@
import Tracklist from "./tracklist.jsx";
export default Tracklist;

View File

@@ -0,0 +1,44 @@
import React from 'react';
import './tracklist.scss'
class Tracklist extends React.Component
{
render()
{
return(
<div className="tracklist">
<table>
<thead>
<tr>
<th>Name</th>
<th>Course</th>
<th>Lat</th>
<th>Lon</th>
</tr>
</thead>
<tbody>
{ this.props.entities.map((val,index) => {
return (
<tr key={index}>
<td>{val.Name}</td>
<td>{val.Course}</td>
<td>{val.position[0]}</td>
<td>{val.position[1]}</td>
</tr>
)
})}
</tbody>
</table>
</div>
);
}
}
export default Tracklist;

View File

@@ -0,0 +1,8 @@
.tracklist
{
display: flex;
}
td
{
text-align: left;}

View File

@@ -1,4 +1,5 @@
.controls{
display: flex;
width: 20%;
float: left;
}

View File

@@ -1,7 +1,7 @@
import React from 'react';
import './controls.css'
import { sendMsg } from '../api';
import Tracklist from './Tracklist'
class Controls extends React.Component
{
constructor(props) {
@@ -25,7 +25,8 @@ class Controls extends React.Component
render() {
return (
<div className="controls">
<button onClick={this.getMessage}> click me!</button>
<Tracklist entities= {this.props.Entities} />
{/* <button onClick={this.getMessage}> click me!</button> */}
</div>
);
}

View File

@@ -0,0 +1,3 @@
import Controls from "./controls.jsx";
export default Controls;