first commit
This commit is contained in:
29
admin/templates/utils/sentry.tpl
Normal file
29
admin/templates/utils/sentry.tpl
Normal file
@@ -0,0 +1,29 @@
|
||||
{if !isLocalDevelopment()}
|
||||
<script src="/common/static/js/sentry-6.16.1.min.js"></script>
|
||||
|
||||
<script>
|
||||
Sentry.init({
|
||||
dsn: 'https://bfce65214ee44aed9bbf7bb7bddc3113@sentry.wpj.cz/11',
|
||||
denyUrls: [
|
||||
/extensions\//i,
|
||||
/^chrome:\/\//i,
|
||||
/kupshop\.local/i
|
||||
],
|
||||
});
|
||||
|
||||
function getParameterByName(name, url = window.location.href) {
|
||||
name = name.replace(/[\[\]]/g, '\\$&');
|
||||
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
|
||||
results = regex.exec(url);
|
||||
|
||||
if (!results) return null;
|
||||
if (!results[2]) return '';
|
||||
return decodeURIComponent(results[2].replace(/\+/g, ' '));
|
||||
}
|
||||
|
||||
Sentry.setTag("user", "{if isSuperuser()}wpjadmin{else}admin{/if}");
|
||||
Sentry.setTag("s", getParameterByName('s'));
|
||||
Sentry.setTag("l", getParameterByName('l'));
|
||||
Sentry.setTag("r", getParameterByName('r'));
|
||||
</script>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user