diff --git a/front/package.json b/front/package.json index c39805d4f5a78331322c0d460ba62950f637957b..ac3895f6d65655fd198699c92cd55300df301b1e 100644 --- a/front/package.json +++ b/front/package.json @@ -21,6 +21,7 @@ "jwt-decode": "^2.2.0", "lodash": "^4.17.4", "moxios": "^0.4.0", + "raven-js": "^3.22.3", "semantic-ui-css": "^2.2.10", "vue": "^2.3.3", "vue-lazyload": "^1.1.4", diff --git a/front/src/App.vue b/front/src/App.vue index 7e7984d5558895903d2ad2442fbd1f2363e1b0cb..98ad48d3ff41cd37cfa4df496c51c24f8dbd0544 100644 --- a/front/src/App.vue +++ b/front/src/App.vue @@ -22,15 +22,23 @@ </div> </div> </div> + <raven + v-if="$store.state.instance.settings.raven.front_enabled.value" + :dsn="$store.state.instance.settings.raven.front_dsn.value"> + </raven> </div> </template> <script> import Sidebar from '@/components/Sidebar' +import Raven from '@/components/Raven' export default { name: 'app', - components: { Sidebar } + components: { + Sidebar, + Raven + }, created () { this.$store.dispatch('instance/fetchSettings') } diff --git a/front/src/components/Raven.vue b/front/src/components/Raven.vue new file mode 100644 index 0000000000000000000000000000000000000000..e5e125b810ec0cb53e4080d64f3b0c9133305307 --- /dev/null +++ b/front/src/components/Raven.vue @@ -0,0 +1,41 @@ +<template> + <div class="raven"></div> +</template> + +<script> +import Raven from 'raven-js' +import RavenVue from 'raven-js/plugins/vue' +import Vue from 'vue' +import logger from '@/logging' + +export default { + props: ['dsn'], + created () { + Raven.uninstall() + this.setUp() + }, + destroyed () { + Raven.uninstall() + }, + methods: { + setUp () { + Raven.uninstall() + logger.default.info('Installing raven...') + Raven.config(this.dsn).addPlugin(RavenVue, Vue).install() + console.log({}.test.test) + } + }, + watch: { + dsn: function () { + this.setUp() + } + } +} +</script> + +<!-- Add "scoped" attribute to limit CSS to this component only --> +<style scoped > +.raven { + display: none; +} +</style>