index.ejs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=utf-8">
  5. <meta name="robots" content="NONE,NOARCHIVE" />
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title><%= htmlWebpackPlugin.options.title || 'Sentry Dev'%></title>
  8. <script type="text/javascript">
  9. try {
  10. var reg = new RegExp(/\/organizations\/(.+?(?=(\/|$)))(\/|$)/, 'i');
  11. var organization = window.location.pathname;
  12. var slug = organization.match(reg)[1];
  13. var preloadPromises = { orgSlug: slug };
  14. function promiseRequest(url) {
  15. return new Promise(function (resolve, reject) {
  16. var xhr = new XMLHttpRequest();
  17. xhr.open('GET', url);
  18. xhr.onload = function () {
  19. try {
  20. this.status >= 200 && this.status < 300
  21. ? resolve([JSON.parse(xhr.response), this.statusText, xhr])
  22. : reject([this.status, this.statusText]);
  23. } catch(e) {
  24. reject();
  25. }
  26. };
  27. xhr.onerror = function () {
  28. reject([this.status, this.statusText]);
  29. };
  30. xhr.send();
  31. });
  32. }
  33. function makeUrl(suffix) {
  34. return '/api/0/organizations/' + slug + suffix;
  35. }
  36. window.__sentry_preload = preloadPromises;
  37. if (slug !== 'new') {
  38. preloadPromises.organization = promiseRequest(makeUrl('/?detailed=0'));
  39. preloadPromises.projects = promiseRequest(makeUrl('/projects/?all_projects=1&collapse=latestDeploys'));
  40. preloadPromises.teams = promiseRequest(makeUrl('/teams/'));
  41. }
  42. } catch(_) {}
  43. </script>
  44. </head>
  45. <body>
  46. <% if (htmlWebpackPlugin.options.unsupportedBrowser) { %>
  47. <style>.unsupported-browser { display: none; }</style>
  48. <div class="unsupported-browser">
  49. Sorry, your browser is not supported. Please upgrade to
  50. the latest version or switch your browser to use this site.
  51. See <a href="http://outdatedbrowser.com/">outdatedbrowser.com</a>
  52. for options.
  53. </div>
  54. <% } %>
  55. <div id="blk_router">
  56. <div class="loading triangle">
  57. <div class="loading-mask"></div>
  58. <div class="loading-indicator" data-test-id="loading-indicator">
  59. <img src="<%=require('sentry-images/sentry-loader.svg')%>" />
  60. </div>
  61. <div class="loading-message">
  62. <p>Please wait while we load an obnoxious amount of JavaScript.</p>
  63. <p>
  64. <small>You may need to disable adblocking extensions to load Sentry.</small>
  65. </p>
  66. </div>
  67. </div>
  68. </div>
  69. <% if (htmlWebpackPlugin.options.window) { %>
  70. <script>
  71. <% for (var varName in htmlWebpackPlugin.options.window) { %>
  72. window['<%=varName%>'] = <%= JSON.stringify(htmlWebpackPlugin.options.window[varName]) %>;
  73. <% } %>
  74. </script>
  75. <% } %>
  76. </body>
  77. </html>