feat: show connected robots in ui when getting cb pings #15
@@ -4,8 +4,6 @@ export default function ConnectedRobots() {
|
|||||||
|
|
||||||
const [connected, setConnected] = useState<boolean | null>(null);
|
const [connected, setConnected] = useState<boolean | null>(null);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// We're excepting a stream of data like that looks like this: `data = False` or `data = True`
|
// We're excepting a stream of data like that looks like this: `data = False` or `data = True`
|
||||||
const eventSource = new EventSource("http://localhost:8000/robot/ping_stream");
|
const eventSource = new EventSource("http://localhost:8000/robot/ping_stream");
|
||||||
@@ -29,7 +27,7 @@ export default function ConnectedRobots() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return () => eventSource.close();
|
return () => eventSource.close();
|
||||||
});
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
|||||||
Reference in New Issue
Block a user