-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure grafana is always loaded within the SLE iframe #56
Conversation
@pvallone - Do you want to look at these changes, or are you fine with me merging without your review? |
@mollykreis Please feel free to merge without my review. Sorry, I miss GitHub PRs sometimes. It probably makes sense for me to remove myself from code owners given the ownership changes, I'll put up a PR for that. |
In multiple places throughout grafana, it's possible to link between dashboards. With the way that grafana is hosted in an iframe within SLE, this poses some problems. The issue stems from the fact that grafana itself is hosted under the
/dashboardhost
route while the grafana Angular app that hosts the iframe is hosted under/dashboards
. As a result, we run into the following problem:/dashboardhost
route to avoid navigating the iframe to SLE, which results in nested SLE frames/dashboard
route to avoid navigating to grafana hosted outside of the SLE frameBecause we can't know how a given link that's generated will be opened, the best solution is to allow grafana to generate links as though it were not hosted in an iframe (i.e. using
/dashboardhost
) but ensure that if grafana is loaded outside of the SLE frame, we automatically redirect the user to SLE. This is accomplished by redirecting from/dashboardhost
to/dashboards
in the case that grafana is not loaded in an iframe (determined by comparingwindow.self
towindow.top
). The exception to this is when grafana is running onlocalhost
so that grafana can still be run locally without it being hosted in the Angular app.