2026-03-21 20:58:44 +00:00
|
|
|
<template>
|
2026-04-16 17:14:57 +00:00
|
|
|
<router-view />
|
2026-03-21 20:58:44 +00:00
|
|
|
</template>
|
|
|
|
|
|
2026-04-21 23:35:59 +00:00
|
|
|
<script setup lang="ts">
|
2026-04-21 23:58:04 +00:00
|
|
|
import * as Sentry from "@sentry/vue";
|
2026-04-21 23:35:59 +00:00
|
|
|
import { onMounted } from "vue";
|
2026-04-21 23:58:04 +00:00
|
|
|
import { apiClient } from "@/client";
|
2026-04-22 14:31:05 +00:00
|
|
|
import router from "@/route/config";
|
2026-04-21 23:58:04 +00:00
|
|
|
|
2026-04-21 23:35:59 +00:00
|
|
|
import { SSEManager, type SSEMessage } from "@/SSEManager";
|
|
|
|
|
|
2026-04-21 23:58:04 +00:00
|
|
|
async function sentryInit() {
|
|
|
|
|
const config = await apiClient.JSONGet("/api");
|
|
|
|
|
Sentry.init({
|
|
|
|
|
dsn: config.DSN,
|
|
|
|
|
integrations: [Sentry.browserTracingIntegration({ router })],
|
|
|
|
|
environment: config.ENVIRONMENT,
|
|
|
|
|
release: config.RELEASE,
|
|
|
|
|
tracesSampleRate: 0.01,
|
|
|
|
|
});
|
|
|
|
|
console.log("sentry initialized");
|
|
|
|
|
}
|
2026-04-21 23:35:59 +00:00
|
|
|
onMounted(() => {
|
|
|
|
|
SSEManager.connect("/api/events");
|
|
|
|
|
SSEManager.subscribe((msg: SSEMessage) => {
|
|
|
|
|
if (msg.type != "heartbeat") {
|
|
|
|
|
console.log("SSE", msg);
|
|
|
|
|
}
|
|
|
|
|
});
|
2026-04-21 23:58:04 +00:00
|
|
|
sentryInit();
|
2026-04-21 23:35:59 +00:00
|
|
|
});
|
|
|
|
|
</script>
|