rikukissa / node-red-contrib-image-output

🏞 Easy way of previewing and examining images in your flows
MIT License
13 stars 6 forks source link

Enable or disable image pushing #5

Closed bartbutenaers closed 4 years ago

bartbutenaers commented 6 years ago

Hi Riku (@rikukissa),

I currently use your contribution for displaying image data, identical like I use the Debug node for displaying non-image data (json, buffers, ...).

But the Debug node has a nice extra feature, which is enable or disable displaying data: by simply pressing a button. I have reused part of their js and html code to add a similar button to your node.

When the button is pressed, it will go half way beneath the node and no more images will be pushed from the server. When the button is pressed again, it will become entirely visible again and images will again be pushed from the server:

image

I would appreciate if you could test this, and have a look whether you want to add this functionality to your new version.

P.S. not all of the history-related code in the html is clear to me, but it seems to do the job ...

Thanks a lot, Bart

rikukissa commented 6 years ago

Good idea! I'll go through the code in more detail as soon as I can.

rikukissa commented 6 years ago

Quick question: does the active state persist between restarts of node-red?

bartbutenaers commented 6 years ago

Quick answer: I added a mix of buttons (enabled and disabled) to my flows and their state was persisted. Did some redeploys and even after a restart of my Node-Red, all buttons maintained their status. Enough for today ;-)

bartbutenaers commented 6 years ago

@rikukissa ,

Sorry for the delay, but it is rather busy at the moment ...

The only thing I find confusing about this button: when your node is located on a disabled flow tab, the user will get a popup "node is not deployed" when he presses the button. This is in fact correct: when the flow tab is disabled, the nodes of that flow are not deployed (so the nodeexists == false). So you cannot (de)activate such a node with the button.

But the users will not always immediately think about the flow tab being disabled.
Any suggestions on this one?? Some possible solutions:

But the Debug node has the same behaviour!!!

Bart

bartbutenaers commented 6 years ago

Hi Riku (@rikukissa ),

I'm going to wait with my 2 new pull requests (one for displaying image properties, and one for the grab handle) until you have approved and merged this one into your master. Otherwise my fork is going to become a mess...

Hope to hear from you soon, Bart

bartbutenaers commented 6 years ago

Hello Riku (@rikukissa ),

Did you had already a chance to have a look at the changes. Would be great if we could finish the pull requests, so you can get rid of your poltergeist ;-)

Thanks, Bart