Hi,
I'm thinking to build an index webpage that contains links to all of the implemented uibuilder endpoints (each node instance in you flows).
That is easy to to by putting something like the following inside the module.exports section of the node js
RED.httpNode.get('/uibindex', RED.auth.needsPermission('uibuilder.read'), function(req,res) {
...
})
This is the same as creating an admin API endpoint but using the httpNode
instead of the httpAdmin
web sever instance.
However, getting to the point, I would like to create links that would take people direct to the Node-RED admin flow containing the relevant node in a similar way to the way that the admin search works.
So my question is, is there a way to create a link that will take a user to a specific part of their flows?
I'm already collecting the required data:
{"c1c3ed5.2c6ce1":"heating","bc8a8804.292de8":"home","7b20a3a6.12567c":"vue","963f6e2c.6d318":"uib"}
So I have the node ID and the corresponding uibuilder URL for all instances, I just need a way to create a "search" link from the ID's.
Currently we only support linking to individual flows (or subflows) - as you can see from the url that changes when you click between tabs.
There's an open item on the backlog (has been for some time...) to support other url formats to deep-link to different things, but it doesn't exist today.
Where would these links exist? If they are already inside the editor, then you have access to the RED
api and there are various things you can do to jump around and reveal nodes, or bring up the search dialog pre-filled in.
OK, no worries, it would be a nice to have but certainly isn't critical.
Is it possible to get at the flow ID from within a custom node? At least that would get me close.
In a separate URL so it isn't inside the admin UI.
I couldn't think of a good place to put them in the Admin UI. Also, this is a single list based on all of the uibuilder nodes added to flows. Finally, with an added query parameter, it will be available as an API as well returning JSON in case anyone wants to build the information into their own dashboard. I really hadn't quite realised just how easy it is for a node to do this
I don't suppose it is possible to add an entry into the admin menu is it? That might be workable.
I'm open to other suggestions though I'm not going to bust a gut over it, it just seemed like a nice idea so I ran with it. I have the data as it is the easiest way to track which instances exist and which url's they are associated with. I'll be also using the list to help ensure that you don't end up with two endpoints with the same URL. Potentially, it could also be used to enable the ability to send data from one node instance to the front-end of a different node instance - but I'm already getting well ahead of myself.