Flowfuse dashboard issue displaying an image

Could someone with more knowledge than myself with using a ui-template to display an image in D2 have a look at this issue please? The guy thinks that it is a bug but I I suspect it is just a matter of knowing how to do it. The problem is that the image is not retained when the template is not on the current page.

Is the problem that the image is not remaining in tact when the template is moved to a different group or that it will not show anymore when clicking the buttons? Not entirely clear but either way, I used his example and when moving the template node to a new group, the image is still there and can be toggled by the buttons.

I cannot duplicate his issue, so I don't know what's going wrong for him. (browser console output may help)

1 Like

My understanding is that the issue arises when the template is on a different page to the button invoking it. The image does not then appear when switching to that page. But I may not be understanding fully.

Yeah, I moved the template node first to a new group on the same page, still worked... then moved to a new page entirely (opened in a new window on my second monitor) and it still worked... the image that was sent to the node before moving it to a new page was even still showing when I navigated to the new page in my browser.

Isn't that because D2 removes the "page" that is navigated away from instead of retaining it in the browser? That's why I suggested adding the template to the head instead of the body. A template can be anywhere.

Yes, I think the technique to be used is to watch for messages coming in and save the data, then in mounted() display it. The skeleton code included when a new ui-template is added includes the hooks to do that, and the documentation is pretty good I think.

Seems very complex to me. :wink: :rofl:

This has all been cleared up now, it turns out that problem was seen when the template widget was viewed from a different browser tab to the button being clicked, not when the template was in a different dashboard page viewed in the same browser tab. Somehow the ui-template node type had been selected to respond to Client Data so that it was not updated if the button was clicked in a different browser tab.

That should still work though... will test tomorrow.

unless you open in another browser/incognito mode or something.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.