reload tab

1,082 views
Skip to first unread message

David Caparrós

unread,
Feb 21, 2018, 3:41:52 PM2/21/18
to Node-RED
How can I force to reload the dashboard view on the browser with un_control?

I'm displaying a picture on a template after some action but the picture is not refreshed unless I reload the dashboard tab from chrome and wanted to know how to force this directly from node red.

Thanks in advance

Dave C-J

unread,
Feb 21, 2018, 4:01:43 PM2/21/18
to node...@googlegroups.com
Does the info not tell you....
Inline images 1
oh yes it does

David Caparrós

unread,
Feb 21, 2018, 4:27:23 PM2/21/18
to Node-RED
Sorry Dave....

Thanks too

David Caparrós

unread,
Feb 21, 2018, 4:38:46 PM2/21/18
to Node-RED
Don't ask me why but on google Chrome is not working....

If I go to the explorer and click on refresh then the picture is reloading ok however If I use the ui_control and inject "" or no msg.payload or even if I make to go +1 and one second later -1 it's the same, picture does not refresh, seems page is not reloaded and keep what is on the cache.

Templete has just this:


<div height="210" style="height: 210px;">
<img src="/grab.jpg" width="280"><br/>
<a href="/grab.jpg" target="_blank">Full screen</a>
</div>


I don't know how to force it with code to auto refresh when I wanted.

Regards

Dave C-J

unread,
Feb 21, 2018, 5:55:42 PM2/21/18
to node...@googlegroups.com
rather than try and reload the same thing - which indeed will cache... you need to inject a new image...
so put that code into a "normal" template and then use a default ui_template (expecting the msg.payload)...
change the /grab.jpg  to /grab.jpg?{{msg.payload}}  and inject a timestamp...
so you inject a timestamp - that gets added to the url in the first template - which then updates the dashboard template - and the timestamp acts as a cahce-buster and forces an image reload.  Set inject to repeat at whatever frequency you want... or arrange for a function to act as an inject based on an event.

Torsten Schmale

unread,
Feb 22, 2018, 7:11:18 AM2/22/18
to Node-RED
Sounds complicated Dave.
Sending "" to really enforce reload would be better, IMHO

regards
Torsten

Colin Law

unread,
Feb 22, 2018, 7:29:32 AM2/22/18
to node...@googlegroups.com
I don't think there is a way to force the browser to reload an image that it already has, though I may be wrong.  The method outlined by Dave is the conventional way of achieving what you want on any website (node red based or otherwise).

Colin

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/a4d04b5b-dc2b-48a3-83d9-504b36565d2b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages