add sentry for webui error reporting

This commit is contained in:
ArabCoders 2025-02-27 23:54:49 +03:00
parent 3a964a6ac3
commit 689ce421e9
6 changed files with 919 additions and 10 deletions

View file

@ -143,6 +143,9 @@ class Config:
file_logging: bool = False
"Enable file logging."
sentry_dsn: str | None = None
"The Sentry DSN to use for error reporting."
_manual_vars: tuple = (
"temp_path",
"config_path",
@ -200,6 +203,7 @@ class Config:
"basic_mode",
"default_preset",
"instance_title",
"sentry_dsn",
)
"The variables that are relevant to the frontend."

View file

@ -93,6 +93,7 @@ import 'assets/css/style.css'
import 'assets/css/all.css'
import { useStorage } from '@vueuse/core'
import moment from 'moment'
import * as Sentry from "@sentry/nuxt";
const Year = new Date().getFullYear()
const selectedTheme = useStorage('theme', 'auto')
@ -144,6 +145,8 @@ const applyPreferredColorScheme = scheme => {
}
}
watch(() => config.app.sentry_dsn, dsn => dsn ? Sentry.init({ dsn: dsn }) : null)
onMounted(async () => {
try {
applyPreferredColorScheme(selectedTheme.value)

View file

@ -33,6 +33,7 @@ export default defineNuxtConfig({
domain: '/',
wss: process.env.VUE_APP_BASE_URL ?? '',
version: '2.0.0',
sentry: process.env.NUXT_PUBLIC_SENTRY_DSN ?? '',
}
},
build: {
@ -60,6 +61,7 @@ export default defineNuxtConfig({
'@pinia/nuxt',
'@vueuse/nuxt',
'floating-vue/nuxt',
'@sentry/nuxt/module',
],
nitro: {

View file

@ -12,6 +12,7 @@
"web-types": "./web-types.json",
"dependencies": {
"@pinia/nuxt": "^0.5.1",
"@sentry/nuxt": "^9.2.0",
"@vueuse/core": "^10.9.0",
"@vueuse/nuxt": "^10.9.0",
"@xterm/addon-fit": "^0.10.0",

View file

@ -15,6 +15,7 @@ const CONFIG_KEYS = {
basic_mode: true,
default_preset: 'default',
instance_title: null,
sentry_dsn: null,
},
presets: [
{

File diff suppressed because it is too large Load diff