Closed rtnpro closed 9 years ago
Trying to load the dashboard at https://apps.stg.fedoraproject.org/statscache/web/dashboard throws the following errors on console:
GET https://apps.stg.fedoraproject.org/api/release-engineering-event-logs?limit=8 404 (Not Found)k.cors.a.crossDomain.send @ jquery-2.1.4.min.js:4n.extend.ajax @ jquery-2.1.4.min.js:4$.ajax.success @ dashboard:189j @ jquery-2.1.4.min.js:2k.fireWith @ jquery-2.1.4.min.js:2x @ jquery-2.1.4.min.js:4(anonymous function) @ jquery-2.1.4.min.js:4 dashboard:192 error: error jquery-2.1.4.min.js:4 GET https://apps.stg.fedoraproject.org/api/volume-1m?limit=8 404 (Not Found)k.cors.a.crossDomain.send @ jquery-2.1.4.min.js:4n.extend.ajax @ jquery-2.1.4.min.js:4$.ajax.success @ dashboard:189j @ jquery-2.1.4.min.js:2k.fireWith @ jquery-2.1.4.min.js:2x @ jquery-2.1.4.min.js:4(anonymous function) @ jquery-2.1.4.min.js:4 dashboard:192 error: error jquery-2.1.4.min.js:4 GET https://apps.stg.fedoraproject.org/api/volume-1s?limit=8 404 (Not Found)k.cors.a.crossDomain.send @ jquery-2.1.4.min.js:4n.extend.ajax @ jquery-2.1.4.min.js:4$.ajax.success @ dashboard:189j @ jquery-2.1.4.min.js:2k.fireWith @ jquery-2.1.4.min.js:2x @ jquery-2.1.4.min.js:4(anonymous function) @ jquery-2.1.4.min.js:4 dashboard:192 error: error jquery-2.1.4.min.js:4 GET https://apps.stg.fedoraproject.org/api/volume-5s?limit=8 404 (Not Found)k.cors.a.crossDomain.send @ jquery-2.1.4.min.js:4n.extend.ajax @ jquery-2.1.4.min.js:4$.ajax.success @ dashboard:189j @ jquery-2.1.4.min.js:2k.fireWith @ jquery-2.1.4.min.js:2x @ jquery-2.1.4.min.js:4(anonymous function) @ jquery-2.1.4.min.js:4 jquery-2.1.4.min.js:4 GET https://apps.stg.fedoraproject.org/api/volume-by-category-1m?limit=8 404 (Not Found)k.cors.a.crossDomain.send @ jquery-2.1.4.min.js:4n.extend.ajax @ jquery-2.1.4.min.js:4$.ajax.success @ dashboard:189j @ jquery-2.1.4.min.js:2k.fireWith @ jquery-2.1.4.min.js:2x @ jquery-2.1.4.min.js:4(anonymous function) @ jquery-2.1.4.min.js:4 2dashboard:192 error: error jquery-2.1.4.min.js:4 GET https://apps.stg.fedoraproject.org/api/volume-by-category-1s?limit=8 404 (Not Found)k.cors.a.crossDomain.send @ jquery-2.1.4.min.js:4n.extend.ajax @ jquery-2.1.4.min.js:4$.ajax.success @ dashboard:189j @ jquery-2.1.4.min.js:2k.fireWith @ jquery-2.1.4.min.js:2x @ jquery-2.1.4.min.js:4(anonymous function) @ jquery-2.1.4.min.js:4 jquery-2.1.4.min.js:4 GET https://apps.stg.fedoraproject.org/api/volume-by-category-5s?limit=8 404 (Not Found)k.cors.a.crossDomain.send @ jquery-2.1.4.min.js:4n.extend.ajax @ jquery-2.1.4.min.js:4$.ajax.success @ dashboard:189j @ jquery-2.1.4.min.js:2k.fireWith @ jquery-2.1.4.min.js:2x @ jquery-2.1.4.min.js:4(anonymous function) @ jquery-2.1.4.min.js:4 2dashboard:192 error: error
Generating URLS like: https://github.com/fedora-infra/statscache/blob/develop/statscache/templates/dashboard.html#L95 in javascript does not account for adding proper base path prefix for the URL, which is statscache in our case/
statscache
Using {{ url_for('<route name>') }} takes care of this issue.
{{ url_for('<route name>') }}
Problem statement
Trying to load the dashboard at https://apps.stg.fedoraproject.org/statscache/web/dashboard throws the following errors on console:
Reason
Generating URLS like: https://github.com/fedora-infra/statscache/blob/develop/statscache/templates/dashboard.html#L95 in javascript does not account for adding proper base path prefix for the URL, which is
statscache
in our case/Solution
Using
{{ url_for('<route name>') }}
takes care of this issue.