added sentry integration (#5)
* added sentry integration * added environment parameter to sentry * test error * remove test func
This commit is contained in:
parent
7bcc4948cb
commit
2c35bf6c8e
|
|
@ -10,10 +10,15 @@ replaceHtmlUrls () {
|
|||
sed -i "s/$1/$2/" "./vnc.html"
|
||||
}
|
||||
|
||||
replaceTagVersion () {
|
||||
sed -i "s/TAG_VERSION/${tag}/" "./vnc.html"
|
||||
}
|
||||
|
||||
prepareHtml () {
|
||||
cdn="\/\/static-assets.codio.com\/${folder}\/${tag}"
|
||||
replaceHtmlUrls "href=\"app\/" "href=\"${cdn}\/app\/"
|
||||
replaceHtmlUrls "src=\"app\/" "src=\"${cdn}\/app\/"
|
||||
replaceTagVersion
|
||||
}
|
||||
|
||||
readarray -d '' files < <(find ./ -type f -print0)
|
||||
|
|
|
|||
19
vnc.html
19
vnc.html
|
|
@ -43,13 +43,28 @@
|
|||
<link rel="preload" as="image" href="app/images/info.svg">
|
||||
<link rel="preload" as="image" href="app/images/error.svg">
|
||||
<link rel="preload" as="image" href="app/images/warning.svg">
|
||||
|
||||
<script
|
||||
src="https://js.sentry-cdn.com/d08e273c89d12afcde41b3ec30d37ace.min.js"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
<script>
|
||||
const prodRe = /https:\/\/.+\.codio\.io$/
|
||||
const prodUkRe = /https:\/\/.+\.codio-box\.uk$/
|
||||
const isProd = prodRe.test(location.origin) || prodUkRe.test(location.origin)
|
||||
Sentry.onLoad(function() {
|
||||
Sentry.init({
|
||||
// No need to configure DSN here, it is already configured in the loader script
|
||||
// You can add any additional configuration here
|
||||
release: 'TAG_VERSION',
|
||||
environment: isProd ? 'production' : 'development'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="module" crossorigin="anonymous" src="app/error-handler.js"></script>
|
||||
<script type="module" crossorigin="anonymous" src="app/ui.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="noVNC_fallback_error" class="noVNC_center">
|
||||
<div>
|
||||
<div>noVNC encountered an error:</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue