Updated dashboard code using flask socketsio