如何让 node-red
检测到 dashboard UI
页面已被访问,即有人正在查看该页面。
我这么说是因为我会比没有人访问时更频繁地向仪表板发送更新。我知道我可以实现 Websockets,但这将是我创建的页面,而不是仪表板 UI
I have looked everywhere, and in forums, no solutions offered besides create a custom webpage
最佳答案
发生这种情况时,ui_control
节点可用于发出消息。
从 ui_control
节点的信息侧边栏:
When any browser client connects or loses connection, or changes tab, this node will emit a
msg
containing:
payload
- connect, lost, or change.socketid
- the ID of the socket (this will change every time the browser reloads the page).socketip
- the ip address from where the connection originated.tab
- the number of the tab. (Only for 'change' event).name
- the name of the tab. (Only for 'change' event).
关于user-interface - Node-Red 检测仪表板页面访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55690004/