I'm having trouble using UI control! I send the object to it with the page I want to display and nothing works. I confess that I find the use of pages and groups in dashboard 2.0 quite confusing. Create a page and place an element in it without a group and the page is not displayed on the left side like others with a group. The nodes ui control asks me to indicate a page for it to be pinned. I confess that I don't understand its use well. In 1.0 this manipulation was very simple, but it is very confusing. I'm also having problems with the constant need to update the page manually, something that 1.0 does naturally.
Hi @diegodamaceno - there seem to be a few points being made in this post:
ui-control not working
The confusion of pages and groups
If a template is page-scoped, it does not show in the side navigation "Dashboard 2.0" menu
The need to update the UI each time (I'm guessing you mean refresh here?)
The screenshot you've included which is not linked to any of the previous 4 points
I will tackle the points separetely below:
1. ui-control not working
The ui-control needs to be bound to a UI/Dashboard. Eventually, we would like to support multiple Dashboards/UIs in a single Node-RED instance, and this plan is what drives the need for the "UI" choice each time.
As long as you've bound it to your "UI" in the ui-control configuration, the ui-control should work. If it is not, please let me know what msg.payload you are sending to it.
If you're looking to force a navigation, then you will just need to include the page name as a string in the msg.payload
2. The confusion of pages and groups
The use of groups and pages was explicitly taken from the original Node-RED Dashboard. There is no difference in their implementation, so I'm not sure what you think has changed?
The only additional layer we have introduced is the "UI", which is a layer below "Pages", i.e. your UI contains all of your pages.
3. Page Scoped Templates
This is likely a bug
4. Refresh Required
I'm not aware of this being a requirement, it certainly shouldn't be. What are you trying to update/refresh whereby this is a requirement?
5. Screenshot
Please raise an issue on GitHub for this, that is a bug within the Node-RED sidebar.
After the last update, some bugs were resolved, so I still only have the problem of disabling groups that are not disappearing from the panel when they are marked as hide.
I am not sure, exactly, what the problem is so I hope this is not 'teaching granny to suck eggs'
Using just the function above does hide the relevant pages. The problem is, if you are ON page 'Neway Automações' although it has been hidden in the menu, you are still on the page.
In fact, Sending an array of objects sends them to multiple outputs, so element 0 goes to o/p 1, element 1 to o/p 2 etc. An array of just one object sends it to o/p 1. So sending an array is pointless, but harmless, in this case.
Everything I showed is functional, but it doesn't work when configured for groups. I will leave a function that I already use successfully in 1.0 that in the same way or in the same way does not work in 2.0.
Then set the Template node to output as Parsed JSON and send this to UI-Control.
Sending as Plain text would generate errors (array errors, page can not be found, etc), as would using ' instead of ". Setting the page name in the groups array is a requirement. Omitting the " surrounding pages and groups will also result in an error.
Documentation does not cover using Template node, which imho would be the most low-code option.
The UI-Control node appears to be picky and unforgiving with regard to its required input. Only got it working after several hours of experimenting (over several days..). Very frustrating and as said the docs don't help much.
Hope someone will benefit from this. And yes, the UI-Control node needs some work (imho).
What are you using to trigger the injection? The more "Node-RED" way of doing this is with a Change node - and set msg.payload accordingly.
The docs are very clear that an object is required. I would argue it was reasonable for it to fail when sending "plain text" i.e. a string, or using ' as neither are valid JSON payloads.
The documentation of the ui-control node details how to use the ui-control node. I don't think it is reasonable for me to have to detail every variation of other Node-RED nodes that could format an object. That’s general Node-RED learning, that whilst its valuable, doesn't belong in Node-RED Dashboard documentation.
I am open to documentation improvements, but I will stand on a hill and say that I support everything that the documentation details, i.e. if you follow the specifications detailed in the documentation, it will work.
Please do open issues detailing the expected areas of improvement and link to them here. I stand by though that ui-control does everything it specifies in the documentation reliably.
Now trying this approach without success. Using a function node to do a simple password validation and thus implementing the panel and groups that such a password can show.
Which version of @flowfuse/node-red-dashboard are you running? Do you see any errors in the Node-RED debug panel, the the developer tools console in the browser, or in the console logs for Node-RED itself?