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

download of ILAMB directory not showing overall score colors in a local Mac browser (Chrome or Safari) #99

Open
mcguirepatr opened this issue Aug 27, 2024 · 7 comments

Comments

@mcguirepatr
Copy link

My supercomputer's web pages aren't working right now, so to view the ILAMB output, I needed to download the ILAMB directory to my Mac. But when I download the ILAMB directory , it is not showing the overall score colors on the main page in a local Mac browser (Chrome or Safari). Can you tell me what I should do to fix this? The individual pages (i.e., GPP->FLUXCOM) work fine.
Patrick McGuire

@mcguirepatr
Copy link
Author

When I open it up in Chrome Developer, I see this message:
Access to XMLHttpRequest at 'file:///Users/pmcguire/Desktop/work/projects/ILAMB2/GCP_210824a4/scalars.json' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, isolated-app, chrome-extension, chrome, https, chrome-untrusted.
I will ask ChatGPT.
Patrick McGuire

@minxu74
Copy link
Contributor

minxu74 commented Aug 27, 2024

Please try to use python local http server by typing "python -m http.server" in the ILAMB directory. Then use the web browser to open "http://127.0.0.1:8000/index.html" to solve the cors error.

@mcguirepatr
Copy link
Author

ChatGPT suggests that one option (not recommended for production) is:
Disable CORS in Chrome:
open -na "Google Chrome" --args --disable-web-security --user-data-dir="/tmp/chrome_dev"

This works!
PCM

@mcguirepatr
Copy link
Author

This option doesn't work with Safari 17.6, however.
But I can use Chrome on my Mac instead, with this option, when the supercomputer webserver isn't working.
PCM

@mcguirepatr
Copy link
Author

Please try to use python local http server by typing "python -m http.server" in the ILAMB directory. Then use the web browser to open "http://127.0.0.1:8000/index.html" to solve the cors error.

It looks like I don't have python installed currently on my Mac....
Thanks for the tip, though. ChatGPT had also suggested this as an option.
Patrick

@minxu74
Copy link
Contributor

minxu74 commented Aug 27, 2024

The another way to solve it is to use the unified dashboard as it does not use XMLhttprequest from JQuery to load the json file. 1. try to open dashboard.html in the ILAMB directory using a web browser, 2. click the "browser...' button to load the "scalar_database.json", 3. click the menu on the left-upper corner to select two dimensions that you want to show and other interactive features.

@mcguirepatr
Copy link
Author

Thanks, Dr. Xu!
That was a great suggestion, and it works fine in Safari, after a quick test drive.
Patrick

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants