Input locked for user - in Runtime

Hello friends,

I would like to know if there is a certain property in dasboard_ui controls.

The following is:

I would like some input type widgets like: text/sliders/dropdown and other input.

I would like to disable the possibility for the user to change it at runtime.

I know that there is enable/disable but I don't know if there is "locked".

Some programming languages ​​have this property.

Does dasboard_ui have this feature?

What is the difference?

When you disable the object. He disappears from the screen.

When you lock the object, it continues to be shown on the screen, but the user cannot move it.

That's different to how I understand it.

disabled means it doesn't accept input.
It is (or should be) still visible.

Unless you are talking at the EDIT level.
(After re-reading your post, I fear that is where the confusion is)

Get an inject node just before the GUI node.
Set the inject node to:
msg.enabled --> false and connect the output of the inject node to the GUI node.
Press the inject node (after deploy) and see if that gets what you want to do on the GUI side of things.

What do you mean by cannot move it? Are you talking about using the node-red dashboard or the node-red flow editor? I assumed you were talking about the dashboard. Or perhaps you mean move the slider. If so then @Trying_to_learn is correct. If you disable the ui-node it should go grey (I think) and not allow input.

First I want to apologize if I wrote something wrong. It's just that my original language is Portuguese Brazil.

I use google translate to translate.

When I refer to "Locked" I am referring to the dasboard_ui element on the user's screen.

I don't mean the nods in nod-red.

The current dasboard_ui configuration is when you disable it, it adds the element to the screen. It does not lock the element.

That's the point.

I wanted to know if there is a way to lock the element on the screen I don't want it to disappear from the screen.

Try what I said.

[{"id":"f9b89c2217155145","type":"inject","z":"f7d630bfc1b2f259","name":"Disable","props":[{"p":"disabled","v":"true","vt":"bool"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":210,"y":2800,"wires":[[]]}]

Screenshot from 2023-01-05 09-21-04

is not work

image

image

I believe it is msg.enabled not msg.disabled and false to disable. and true to enable.

1 Like

Thanks for that.

Greatest apologies for my mistake.

After @E1cid corrected it, have you had any luck?

No, there is no such feature in the node-red dashboard

[{"id":"b804e441c7dae229","type":"inject","z":"bbf5094bc59a03b8","name":"Enable","props":[{"p":"enabled","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":900,"y":1020,"wires":[["b47974f481265742"]]},{"id":"b47974f481265742","type":"ui_slider","z":"bbf5094bc59a03b8","name":"","label":"slider","tooltip":"","group":"e7248049173432e6","order":3,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":10,"step":1,"className":"","x":1030,"y":1020,"wires":[[]]},{"id":"8a64fabb6ede9a7b","type":"inject","z":"bbf5094bc59a03b8","name":"Disable ","props":[{"p":"enabled","v":"false","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":890,"y":1060,"wires":[["b47974f481265742"]]},{"id":"e7248049173432e6","type":"ui_group","name":"Default","tab":"4416caf9db5c96d9","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"4416caf9db5c96d9","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Well this non-existent feature seems to work for me, as in the flow posted by @smanjunath211

modified the flow to include enable/disable button in dashboard and inject nodes in editor

import this flow and let us know where are you having issue

image

enable_disable

[{"id":"b804e441c7dae229","type":"inject","z":"bbf5094bc59a03b8","name":"Enable","props":[{"p":"enabled","v":"true","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":870,"y":1020,"wires":[["b47974f481265742"]]},{"id":"b47974f481265742","type":"ui_slider","z":"bbf5094bc59a03b8","name":"","label":"slider","tooltip":"","group":"e7248049173432e6","order":3,"width":0,"height":0,"passthru":true,"outs":"all","topic":"topic","topicType":"msg","min":0,"max":10,"step":1,"className":"","x":1050,"y":1020,"wires":[[]]},{"id":"8a64fabb6ede9a7b","type":"inject","z":"bbf5094bc59a03b8","name":"Disable ","props":[{"p":"enabled","v":"false","vt":"bool"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":870,"y":1060,"wires":[["b47974f481265742"]]},{"id":"3eb5f221ddaabbb4","type":"ui_button","z":"bbf5094bc59a03b8","name":"","group":"e7248049173432e6","order":1,"width":0,"height":0,"passthru":false,"label":"Enable","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"true","payloadType":"bool","topic":"topic","topicType":"msg","x":880,"y":1120,"wires":[["dc814d450f45a513"]]},{"id":"046bd96d83fe934d","type":"ui_button","z":"bbf5094bc59a03b8","name":"","group":"e7248049173432e6","order":1,"width":0,"height":0,"passthru":false,"label":"Disable","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"false","payloadType":"bool","topic":"topic","topicType":"msg","x":880,"y":1160,"wires":[["dc814d450f45a513"]]},{"id":"dc814d450f45a513","type":"change","z":"bbf5094bc59a03b8","name":"","rules":[{"t":"set","p":"enabled","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":1140,"wires":[["b47974f481265742"]]},{"id":"e7248049173432e6","type":"ui_group","name":"Default","tab":"4416caf9db5c96d9","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"4416caf9db5c96d9","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]
2 Likes

It really worked perfectly in your flow.

But I was confused because when you are not at runtime and you disable it, it disappears from the screen.

I apologize.

1 Like

I can see how that could be confusing. When you disable it in the editor you are effectively removing the node from the flow. When you disable it at run time you are disabling the user access to the node, not removing it from the flow. Ideally there would be different words for the two cases.

1 Like

Now I understood what the OP meant by not appearing in dashboard after disabling,

image

image

this is what he meant.

yes, is this is very confuse!!

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