I want to update only the text but without updating the whole page, I don't know how to use websockets and I don't understand the examples on the web. I have managed to update the entire grid but the idea is that the page with the cameras is not updated, only the text
var socket=new WebSocket("ws://localhost:8083/ws")
setInterval(() => {
socket.send("updateJaula")
}, 2000);
<div class="datos generales">
<label id="lblNombreJaula" class="lbl-osd">NOMBRE:`+Object.values(jaula)[i].Nombre+`</label>
<br>
<label id="lblObjetivoJaula" class="lbl-osd">OBJETIVO:`+Object.values(jaula[i].Objetivo+`</label>
<br>
<label id="lblVisitaJaula" class="lbl-osd">VISITAS:`+Object.values(jaula)[i].Visita+`</label>
</div>
I really don't understand what to do, but I load the page with this from golang:
func HTTPAPIFullScreenMultiView(c *gin.Context) {
var createParams MultiViewOptions
SearchScreen(c.Param("uuid"))
err := c.ShouldBindJSON(&createParams)
if err != nil {
log.WithFields(logrus.Fields{
"module": "http_page",
"func": "HTTPAPIFullScreenMultiView",
"call": "BindJSON",
}).Errorln(err.Error())
}
log.WithFields(logrus.Fields{
"module": "http_page",
"func": "HTTPAPIFullScreenMultiView",
"call": "Options",
}).Debugln(createParams)
c.HTML(http.StatusOK, "fullscreen.html", gin.H{
"port": Storage.ServerHTTPPort(),
"screens": SearchScreen(c.Param("uuid")),
"streams": Storage.Streams,
"jaulas": ListarJaulas(),
"version": time.Now().String(),
"options": createParams,
"page": "fullscreen",
"query": c.Request.URL.Query(),
"uuid": c.Param("uuid"),
})
}