load sentry on the client side as well
This commit is contained in:
parent
51cf43d073
commit
ced259d7e8
|
@ -28,6 +28,15 @@ def load_viewer():
|
|||
def inject_version():
|
||||
return dict(version=version.version)
|
||||
|
||||
@app.context_processor
|
||||
def inject_sentry():
|
||||
if sentry:
|
||||
client_dsn = app.config.get('SENTRY_DSN').split('@')
|
||||
client_dsn[:1] = client_dsn[0].split(':')
|
||||
client_dsn = ':'.join(client_dsn[0:2]) + '@' + client_dsn[3]
|
||||
return dict(sentry_dsn=client_dsn)
|
||||
return dict()
|
||||
|
||||
@app.after_request
|
||||
def touch_viewer(resp):
|
||||
if 'viewer' in g and g.viewer:
|
||||
|
|
|
@ -12,7 +12,12 @@
|
|||
<meta name='og:type' content='website' />
|
||||
<meta name='twitter:card' content='summary' />
|
||||
<meta name='twitter:site:id' content='808418'/>
|
||||
<script async src="{{ st('version.js') }}"></script>
|
||||
|
||||
{% if sentry_dsn -%}
|
||||
<script defer src="https://cdn.ravenjs.com/3.17.0/raven.min.js" crossorigin="anonymous"
|
||||
onload="Raven.config('{{sentry_dsn}}').install()"></script>
|
||||
{% endif -%}
|
||||
<script defer src="{{ st('version.js') }}"></script>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
|
|
Loading…
Reference in New Issue