Skip to content

Commit

Permalink
Updated the neptune ui to have the sentry code
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrishnasanka committed Oct 2, 2021
1 parent e39b227 commit 77dcec0
Show file tree
Hide file tree
Showing 3 changed files with 12,705 additions and 12,079 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
},
"dependencies": {
"@mdi/js": "^4.8.95",
"@sentry/tracing": "^6.1.0",
"@sentry/vue": "^6.1.0",
"axios": "^0.19.2",
"core-js": "^3.6.2",
"vue": "^2.6.11",
Expand Down
108 changes: 61 additions & 47 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,73 +11,87 @@
//
// * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/base'
import './plugins/chartist'
import './plugins/vee-validate'
import './plugins/vue-world-map'
import vuetify from './plugins/vuetify'
import i18n from './i18n'
import VueSocketIO from 'vue-socket.io'
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import "./plugins/base";
import "./plugins/chartist";
import "./plugins/vee-validate";
import "./plugins/vue-world-map";
import vuetify from "./plugins/vuetify";
import i18n from "./i18n";
import VueSocketIO from "vue-socket.io";

Vue.config.productionTip = false
import * as Sentry from "@sentry/vue";
import { Integrations } from "@sentry/tracing";

Vue.use(new VueSocketIO({
debug: true,
connection: "http://" + window.location.hostname + ':3000',
// vuex: {
// store,
// actionPrefix: 'SOCKET_',
// mutationPrefix: 'SOCKET_'
// },
// options: { path: "/my-app/" } //Optional options
}))
Sentry.init({
Vue,
dsn:
"https://[email protected]/5633457",
integrations: [new Integrations.BrowserTracing()],
logErrors: true,
// We recommend adjusting this value in production, or using tracesSampler
// for finer control
tracesSampleRate: 1.0
});

Vue.config.productionTip = false;

Vue.use(
new VueSocketIO({
debug: true,
connection: "http://" + window.location.hostname + ":3000"
// vuex: {
// store,
// actionPrefix: 'SOCKET_',
// mutationPrefix: 'SOCKET_'
// },
// options: { path: "/my-app/" } //Optional options
})
);

router.beforeEach((to, from, next) => {
const authRequired = to.matched.some((route) => route.meta.requiresAuth)
const loggedin = store.getters.isLoggedIn
console.log("To:", to.path, "loggedin:",loggedin, "AuthReq:", authRequired)
const authRequired = to.matched.some(route => route.meta.requiresAuth);
const loggedin = store.getters.isLoggedIn;
console.log("To:", to.path, "loggedin:", loggedin, "AuthReq:", authRequired);

if (loggedin && to.path == ''){
console.log('Case -1')
next('/dashboard')
if (loggedin && to.path == "") {
console.log("Case -1");
next("/dashboard");
}

if (loggedin && authRequired) {
console.log("Case 0")
next()
console.log("Case 0");
next();
}

if (!loggedin && !authRequired) {
console.log("Case 1")
console.log("Case 1");
// if (to.path !== '/login') {
// console.log("Case 2")
// next('/login')
// } else {
// console.log("Case 3")
next()
// console.log("Case 3")
next();
// }
} else if (!loggedin && authRequired) {
if (to.path !== '/login') {
console.log("Case 4")
next('/login')
} else {
console.log("Case 5")
next()
}
} else if (!loggedin && authRequired) {
if (to.path !== "/login") {
console.log("Case 4");
next("/login");
} else {
console.log("Case 5");
next();
}
}
next()
})
next();
});

new Vue({
router,
store,
vuetify,
i18n,
render: h => h(App),
}).$mount('#app')


render: h => h(App)
}).$mount("#app");
Loading

0 comments on commit 77dcec0

Please sign in to comment.