mirror of
https://codeberg.org/portospaceteam/ground-dashboard.git
synced 2025-07-29 18:49:59 +01:00
12 lines
345 B
JavaScript
12 lines
345 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))
|
|
console.log( "DATA :" + data)
|
|
dashboard.update(data)
|
|
}
|
|
})()
|