mgr/dashboard: Dashboard should display some helpful (error) message when the iframe-embedded Grafana dashboard failed to load
Due to the fact that most users (and default Ceph deployment) create self-signed certificates for SSL connections, when users log in to the Dashboard most browsers (Chrome and Firefox) will redirect them to a warning page ("Your connection is not private", NET::ERR_CERT_...). To make it clear: this is not a bug but a expected behaviour of certificates for private websites (NOTE: This could be avoided by loading the self-signed certificate as a certification authority in the browser, but it's unlikely that users will do that.)
For a user it's pretty simple to acknowledge the security risk and continue to the Dashboard log-in. Once the user accepted, the browser won't display the warning for a while.
However, things become more complicate then the website using a self-signed certificate is not directly accessed by the user, but embedded via iframe in another site. In this very case the browser will simply block that iframe and won't give any further feedback. So the user will simply see a blank/empty space where they expected to see an embedded Grafana dashboard.
The goal of this tracker is to find a way of improving the user experience by displaying a helpful message to the user: "the embedded Grafana Dashboard was blocked due to a certificate error, please visit the link https://... to accept the security warning". That would at least guide the user the the workaround.Technical guidance:
- iframe elements have onLoad and onError callbacks that could be used to perform actions based on that.
- the UI could previosly perform an HTTP connection to the Grafana URL and load/display error based on the outcome of that connection.
#3 Updated by Ngwa Sedrick Meh over 1 year ago
- Pull request ID set to 45012
Hello Ernesto, I found the server throws a 500 internal server error when the request for a grafana panel is insecure/blocked by SSL so I built on that. A message is displayed instead of the iframe but I couldn't figure out how to let the user accept the certificate. Please help