ground-dashboard/ground/dashboard/static/js/main.js

12 lines
345 B
JavaScript
Raw Normal View History

2022-12-05 22:25:36 +00:00
(() => {
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)
}
})()