ADD: added APP-6 Symbols to the Map

This commit is contained in:
hwinkel
2023-09-05 18:46:34 +02:00
parent 6d2a1d7556
commit 658830bab6
221 changed files with 73498 additions and 21 deletions

51
webapp/src/websocket.js Normal file
View File

@@ -0,0 +1,51 @@
import React from 'react';
import useWebSocket from 'react-use-websocket';
class Websocketclient extends React.Component
{
ws = new WebSocket("ws://127.0.0.1:8008");
constructor(props) {
super(props);
this.state = {
val: null,
};
}
sendMessage(msg )
{
this.ws.send(msg);
}
componentDidMount() {
this.ws.onopen = () => {
console.log("opened");
this.ws.send("test"); // message to send on Websocket ready
};
this.ws.onclose = () => {
console.log("closed");
};
this.ws.onmessage = (event) => {
console.log("got message", event.data);
this.setState({ val: event.data });
};
}
componentWillUnmount() {
}
close()
{
console.log("closing websocket...");
this.ws.close();
}
render() {
return <div>Value: {this.state.val}</div>;
}
}
export default Websocketclient;