mirror of
https://codeberg.org/portospaceteam/ground-dashboard.git
synced 2024-11-29 09:57:00 +00:00
11 lines
300 B
JavaScript
11 lines
300 B
JavaScript
(() => {
|
|
let data = []
|
|
const dashboard = new Dashboard(document.getElementById('main'))
|
|
dashboard.attach()
|
|
const webSocket = new WebSocket(`ws://${window.location.host}/api/data`)
|
|
webSocket.onmessage = (e) => {
|
|
data = data.concat(JSON.parse(e.data))
|
|
dashboard.update(data)
|
|
}
|
|
})()
|