Added sentry and dev environment warning baner

This commit is contained in:
2025-11-29 13:18:24 -05:00
parent 4952ed55ae
commit 1aac9d8c1a
9 changed files with 1044 additions and 41 deletions

View File

@@ -44,6 +44,8 @@ function formatDate(dateStr) {
day: "numeric",
});
}
const environment = import.meta.env.VITE_ENVIRONMENT;
</script>
<template>
@@ -114,10 +116,15 @@ function formatDate(dateStr) {
</DropdownMenuContent>
</DropdownMenu>
<a v-else :href="APIHOST+'/login'">Login</a>
<a v-else :href="APIHOST + '/login'">Login</a>
</div>
</div>
<Separator></Separator>
<Alert v-if="environment == 'dev'" class="m-2 mx-auto w-5xl" variant="info">
<AlertDescription class="flex flex-row items-center text-nowrap gap-5 mx-auto">
<p>This is a development build of the application. Some features will be unavailable or unstable.</p>
</AlertDescription>
</Alert>
<Alert v-if="userStore.user?.loa?.[0]" class="m-2 mx-auto w-5xl" variant="info">
<AlertDescription class="flex flex-row items-center text-nowrap gap-5 mx-auto">
<p>You are on LOA until <strong>{{ formatDate(userStore.user?.loa?.[0].end_date) }}</strong></p>

View File

@@ -8,11 +8,34 @@ import router from './router'
import FormCheckbox from './components/form/FormCheckbox.vue'
import FormInput from './components/form/FormInput.vue'
import * as Sentry from "@sentry/vue";
const app = createApp(App)
app.use(createPinia())
app.use(router)
if (!!import.meta.env.VITE_DISABLE_GLITCHTIP) {
let dsn = import.meta.env.VITE_GLITCHTIP_DSN;
let environment = import.meta.env.VITE_ENVIRONMENT;
Sentry.init({
dsn: dsn,
integrations: [
app,
Sentry.browserTracingIntegration({ router }),
],
tracesSampleRate: 0.01,
environment: environment,
release: 'release tag'
});
}
app.component("FormInput", FormInput)
app.component("FormCheckbox", FormCheckbox)