(2023 Jan 26, 03:56 PM)RandyBryant Wrote:(2023 Jan 26, 03:18 PM)dan Wrote: Hi Randy,
The problem of certain changes not showing up in the UI until a page refresh is due to the fact that the changes happen on the server (raspberry pi) side and are not pushed to the browser until a refresh is done.
I have been looking into a way for the server to cause a page refresh on the browser but I have not found a simple solution. If you have any ideas on how to accomplish this I would be very interested.
Dan
I have limited WEB programming experience, but I'll investigate.
What causes the station updates when the keypad starts a program run? The run times/status shows up with out doing a refresh.
Randy
The way the stations are updated when a program is running is that the home page requests a status update from the server once a second (templates/home.html line ~76). It gets an update from the api_status class in webpages.py (line ~645) which sends a JSON formatted list of status data. JavaScript on the home page updates the display.
You can see the status data at <SIP url>/api/status
I have been tinkering with HTML Server-Sent Events (SSE) to force a page refresh on the browser. One big problem is that if a plugin changes the value of a SIP variable there is no easy way to detect the change unless the plugin notifies the core program.
Dan
<p><br></p>