Skip to content
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

fix: Blocked Loading Mixed Active Content Issue Prevents Chart Viewing on Flexmeasures App #716

Conversation

Ahmad-Wahid
Copy link
Contributor

This update addresses the problem that was preventing the viewing of charts on the Flexmeasures app. By modifying the base.html file, we now perform a check for the flask env variable. If the environment is set to production, the app will utilize the HTTPS protocol; otherwise, it will use HTTP. This adjustment ensures that the loading of mixed active content is unblocked, enabling smooth chart viewing on the app.

Signed-off-by: Ahmad-Wahid <59763365+Ahmad-Wahid@users.noreply.github.com>
@Ahmad-Wahid Ahmad-Wahid requested a review from nhoening June 8, 2023 14:40
@Ahmad-Wahid Ahmad-Wahid self-assigned this Jun 8, 2023
@Ahmad-Wahid Ahmad-Wahid added bug Something isn't working UI labels Jun 8, 2023
Copy link
Contributor

@nhoening nhoening left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@nhoening
Copy link
Contributor

nhoening commented Jun 8, 2023

I just thought that this should get an entry in the changelog.

Now I am a bit stumped describing the problem.
This fixes the mixed active content issue but I don't know under which conditions this happens.
As an example, we can see charts on a PythonAnywhere server, and this issue happened GCE. What might be the difference between these? Is it the usage of Docker containers in the cloud?

@Ahmad-Wahid
Copy link
Contributor Author

Ahmad-Wahid commented Jun 8, 2023

Could we access to that PythonAnyWhere hosted app from external internet?
Yes, I have deployed a docker container app and I don't think this issue would only happen on GCP. Maybe we could face it on other cloud providers too.

Copy link
Contributor

@Flix6x Flix6x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deserves a changelog entry in my opinion as well.

I sometimes use ngrok http 5000 to test how UI features I'm developing would feel on a touchscreen device. It basically forwards my http localhost to a https web url, which leads to the same mixed content issue. I just verified this PR solves that for me, too. Which is great! Although I had to comment out the check for the development flask env. Why aren't we allowing this in development, too?

flexmeasures/ui/templates/base.html Show resolved Hide resolved
@nhoening
Copy link
Contributor

nhoening commented Jun 8, 2023

I do believe this is likely to happen in other production scenarios, but why is PA different? Would be good to understand. We can look at the network tab on the production system and check what URL is called for this API endpoint by the asset page there...

…ue-prevents-chart-viewing-on-flexmeasures-app
…ue-prevents-chart-viewing-on-flexmeasures-app
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
…-chart-viewing-on-flexmeasures-app' of github.com:FlexMeasures/flexmeasures into 714-blocked-loading-mixed-active-content-issue-prevents-chart-viewing-on-flexmeasures-app
@nhoening nhoening merged commit 9a25a48 into main Jun 9, 2023
7 checks passed
@nhoening nhoening deleted the 714-blocked-loading-mixed-active-content-issue-prevents-chart-viewing-on-flexmeasures-app branch June 9, 2023 17:32
@Flix6x Flix6x mentioned this pull request Dec 19, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blocked Loading Mixed Active Content Issue Prevents Chart Viewing on Flexmeasures App
3 participants