[website] report client-side errors to sentry.io (#11039)

This commit is contained in:
Ivan Blinkov 2020-05-19 15:31:08 +03:00 committed by GitHub
parent dbe36dd37d
commit 2f28dbe7d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5701 additions and 3 deletions

View File

@ -144,6 +144,7 @@ def get_js_in(args):
f"'{args.website_dir}/js/jquery.js'",
f"'{args.website_dir}/js/popper.js'",
f"'{args.website_dir}/js/bootstrap.js'",
f"'{args.website_dir}/js/sentry.js'",
f"'{args.website_dir}/js/base.js'",
f"'{args.website_dir}/js/index.js'",
f"'{args.website_dir}/js/docsearch.js'",

View File

@ -1,4 +1,5 @@
(function () {
Sentry.init({ dsn: 'https://2b95b52c943f4ad99baccab7a9048e4d@o388870.ingest.sentry.io/5246103' });
$(document).click(function (event) {
var target = $(event.target);
var target_id = target.attr('id');
@ -7,14 +8,11 @@
var is_collapse = target.attr('data-toggle') === 'collapse';
var is_rating = target.attr('role') === 'rating';
var navbar_toggle = $('#navbar-toggle');
navbar_toggle.collapse('hide');
$('.algolia-autocomplete .ds-dropdown-menu').hide();
if (target_id && target_id.startsWith('logo-')) {
selector = '#';
}
if (selector && selector.startsWith('#') && !is_tab && !is_collapse && !is_rating) {
event.preventDefault();
var dst = window.location.href.replace(window.location.hash, '');

5699
website/js/sentry.js Normal file

File diff suppressed because it is too large Load Diff