Perhaps a noob dashboard question. Not even sure if this was possible in the old dashboard. No idea to be honest.
I want a page in my new dashboard where I have some input query fields, and an "Execute query" button. Then I want to execute a query on my influxdb in my Node-RED flow and show the result on my page in a chart.
But this data (both the input query fields and the result data in the chart) should not be shared with all other dashboards. I mean if meanwhile my wife or my kids have the dashboard open on their smartphones, they are not interested in my query (results). They might even have their own query (results) open at the same time which I don't want to override with my query results. So every dashboard client should have its own copy of the data on this page, which is not shared/synced with the other dashboards clients.
Hopefully it is a bit understandable what I mean...
Is something like that possible with dashboard D2?
Hi @joepavitt,
Thanks a lot for the quick response!!
And thanks to Flowfuse for making this feature available for everybody...
Hopefully you find some time somewhere to add some noob example/info in the release docs, because I am not quite sure yet how I could use it.
But we will see...
Bart
@bakman2,
Yes indeed I have been wondering if a form was the way to go. But since Joe says a standard solutiin is being developed, I will just wait a bit...
Thanks!!
Fundamentally, the new approach is that msg._client.socketId can now be used to constrain communication to a single client for all node types (like ui-control and ui-notification could be in the original Dashboard). You can use this feature to ensure only the output from a form is sent to the relevant socket connection that sent it in the first place.
The new "add client data" function added in v.1.10.0 is a great step forward. Until now I have been inspecting msg._client.socketId and applying accept/reject logic myself. The new function should make life much easier. Thanks @joepavitt.
I am facing a challenge in querying shared (single source of truth) dashboard nodes, when multiple clients are open.
Assume, for example, a shared template node which maintains data. Whenever I send it an update msg, the msg is replicated to all clients, keeping them all in sync. So far so good.
Now suppose I send this node a query msg to which it returns a data response. If I send this query from a server node (e.g. inject), the request will be accepted by all clients, and I will receive multiple (identical) responses.
Currently I collapse these responses into a single msg (per msg._msgid) but would appreciate other ideas from the great minds on this forum, or better still a built-in framework solution.
The difficulty here is that with the Node-RED ecosystem, generally your logic/data is stored server-side, so that you do only have one version of the data. What you've got here is your logic for data storage/generation on the client-side, so you will always have duplication, depending on the number of clients connected? What logic/functionality are you reliant upon in your clients? Can this be moved server-side?
Thanks.
Yes, I am fully aware that I'm trying to handle a client object as if it was a server object. This is for the 'ui-tabulator' node I'm about to release. The table object (AFAIK) can only be instantiated on a client page, and I cannot re-implement its 100's of APIs on the server.
I already implemented a server-side data model of the table (kept in the server datastore and used upon client open/refresh), I may think of improvements in future releases (e.g. designating a "master client" or implementing selected APIs on the server).