alerta / angular-alerta-webui

Alerta Web UI 6.0 (DEPRECATED) - See latest version Web UI 7.0
https://github.com/alerta/alerta-webui
MIT License
69 stars 52 forks source link

Problem in Alerta web UI config.js not found HTTP 404 #183

Closed surajpanda1582 closed 5 years ago

surajpanda1582 commented 5 years ago

I have installed Alerta server and alerta web UI both on same windows server. Alerta server is running fine. When I am running the web UI the alerts are not displaying and I see the following message on the command console /vendor/fonts/glyphicons-halflings-regular.eot? HTTP/1.1" 200 - 404, message File not found /vendor/js/angular-route.min.js.map HTTP/1.1" 404 - 404, message File not found 404, message File not found /vendor/js/angular.min.js.map HTTP/1.1" 404 - /vendor/js/angular-resource.min.js.map HTTP/1.1" 404 - 404, message File not found /vendor/js/angular-sanitize.min.js.map HTTP/1.1" 404 - 404, message File not found /vendor/js/angular.min.js.map HTTP/1.1" 404 - 404, message File not found /vendor/js/angular-route.min.js.map HTTP/1.1" 404 - 404, message File not found /vendor/js/angular-resource.min.js.map HTTP/1.1" 404 - 404, message File not found /vendor/js/angular-sanitize.min.js.map HTTP/1.1" 404 - /config.json HTTP/1.1" 200 - 404, message File not found /config.js HTTP/1.1" 404 -

Below are the config files receives from API server {"actions":[],"alarm_model":{"name":"Alerta 6.5.0"},"audio":{"new":null},"auth_required":false,"client_id":null,"colors":{"highlight":"skyblue ","severity":{"cleared":"#00CC00","critical":"red","debug":"#9D006D","indeterminate":"lightblue","informational":"#00CC00","major":"orange","minor":"yellow","normal":"#00CC00","ok":"#00CC00","security":"blue","trace":"#7554BF","unknown":"silver","warning":"dodgerblue"},"text":"black"},"columns":["severity","status","lastReceiveTime","duplicateCount","customer","environment","service","resource","event","value","text"],"customer_views":false,"dates":{"longDate":"d/M/yyyy h:mm:ss.sss a","mediumDate":"EEE d MMM HH:mm","shortTime":"HH:mm"},"endpoint":"http://localhost:8080","github_url":"https://github.com","gitlab_url":"https://gitlab.com","keycloak_realm":null,"keycloak_url":null,"pingfederate_url":null,"provider":"basic","refresh_interval":5000,"severity":{"cleared":5,"critical":1,"debug":7,"indeterminate":5,"informational":6,"major":2,"minor":3,"normal":5,"ok":5,"security":0,"trace":8,"unknown":9,"warning":4},"signup_enabled":true,"site_logo_url":"","sort_by":"lastReceiveTime","tracking_id":null}

When I see in the internet explorer developer tool I can see the below error Syntax Error in File: controllers.js, Line: 91, Column: 53.

Can anyone please help me resolving this issue. I am not able to find any root cause. Thanks

satterly commented 5 years ago

I would guess it is the "arrow function" ...

window.addEventListener('message', event => { ... }

What version of IE is it? And does it work if you use chrome or firefox?

surajpanda1582 commented 5 years ago

I am using IE11 . I have not tested on chrome or firefox as those are not installed on windows server. Do you say arrow function doesn't work with IE11?

satterly commented 5 years ago

Hard to believe, I know. But yes, IE11 doesn't support arrow functions ...

screenshot 2018-11-30 at 14 34 10
surajpanda1582 commented 5 years ago

Thanks for the help. I changed the arrow operator to normal function and it started working on IE browser. But the URL is not working outside of the windows server where api server is running. It is because of CORS issue. Could you please help me how to create alertad.conf in windows how to configure the path. Thanks

On Fri 30 Nov, 2018, 7:04 PM Nick Satterly <notifications@github.com wrote:

Hard to believe, I know. But yes, IE11 doesn't support arrow functions ...

[image: screenshot 2018-11-30 at 14 34 10] https://user-images.githubusercontent.com/615057/49292264-14c87080-f4ad-11e8-9167-14784aee70a9.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alerta/angular-alerta-webui/issues/183#issuecomment-443204946, or mute the thread https://github.com/notifications/unsubscribe-auth/AjZhhDtQ1V3aoa3Igxb8RfRfXWDV01Toks5u0TQAgaJpZM4Y7jdh .

satterly commented 5 years ago

Just put the URL of your Alerta web UI into the CORS_ORIGINS list as explained here ... https://docs.alerta.io/en/latest/configuration.html#cors-config

For example, this is the list of URLs configured in the demo Alerta API that runs on Heroku ...

screenshot 2018-12-03 at 21 05 44

You can see that https://alerta.herokuapp.com,https://try.alerta.io, and https://explorer.alerta.io are listed as are several "localhost" URLs for testing. The list is comma-separated because it's the environment variable setting, but if using the alertad.conf setting it will need to a proper Python list.

surajpanda1582 commented 5 years ago

Thank you very much. I updated the CORS ORIGIN and its working fine now. Closing the issue.