admin管理员组文章数量:1394142
I have a frontend developed in ReactJS, and a JAVA REST API as backend. Users authenticate and a JWT Token is used in subsequent requests. One feature we are trying to implement is to embed a Grafana Dashboard within the ReactJS frontend. The Grafana dashboard was developed to be as generic as possible. Some Variables are set in the dashboard: 2 variables get the value from URL querystring (GUID of the logged-in user from the ReactJS, and the other gets a GUID corresponding to the data section to filter data). The dashboard will then filter data using both variables. There is also a 3rd variable which is a dropdownlist that filters its value according to the GUID of the 2nd variable: it will fetch data from DB filtering by the Section GUID (hierarquical data, so to say). This works fine on Grafana as long as there is an authenticated Grafana user. My problem is that after sharing externally the dashboard and implementing the URL into the ReactJS application, even though Grafana was setup to allow anonymous access, the dashboard fails:
- it will not get values from URL
- it will not show query variables and the dropdownlists to filter
- data will not be fetched
The goal is to have a generic dashboard able to get data correspondig to the GUIDs set in the URL, making the dashboard available for every user in the ReactJS application.
Why does the dashboard ignore the URL querystring set in the IFrame address? Why doesn't this work unless if there is an active session in Grafana? if I authenticate in Grafana on the same browser where the ReactJS application is running, everything works, which makes me suspect that the issue is a missing cookie used by Grafana after user authentication... I wonder if anyone has a solution for this?
greatly appreciate your help!
本文标签: reactjsembedding Grafana dashboardStack Overflow
版权声明:本文标题:reactjs - embedding Grafana dashboard - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744645555a2617380.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论