[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/jquery.js'",
f"'{args.website_dir}/js/popper.js'", f"'{args.website_dir}/js/popper.js'",
f"'{args.website_dir}/js/bootstrap.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/base.js'",
f"'{args.website_dir}/js/index.js'", f"'{args.website_dir}/js/index.js'",
f"'{args.website_dir}/js/docsearch.js'", f"'{args.website_dir}/js/docsearch.js'",

View File

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