ILAMB icon indicating copy to clipboard operation
ILAMB copied to clipboard

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

Open mcguirepatr opened this issue 1 year ago • 7 comments

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 avatar Aug 27 '24 14:08 mcguirepatr

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

mcguirepatr avatar Aug 27 '24 14:08 mcguirepatr

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.

minxu74 avatar Aug 27 '24 14:08 minxu74

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 avatar Aug 27 '24 14:08 mcguirepatr

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 avatar Aug 27 '24 14:08 mcguirepatr

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

mcguirepatr avatar Aug 27 '24 14:08 mcguirepatr

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.

minxu74 avatar Aug 27 '24 14:08 minxu74

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

mcguirepatr avatar Aug 27 '24 14:08 mcguirepatr