Skip to content

Commit 9c0bf2e

Browse files
committed
use private sentry
1 parent 1d766cd commit 9c0bf2e

File tree

7 files changed

+27
-19
lines changed

7 files changed

+27
-19
lines changed

MaiChartManager/Front/src/App.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineComponent } from 'vue';
2-
import { dateZhCN, NConfigProvider, NDialogProvider, NNotificationProvider, zhCN } from 'naive-ui';
2+
import { dateZhCN, NConfigProvider, NDialogProvider, NMessageProvider, NNotificationProvider, zhCN } from 'naive-ui';
33
import { RouterView } from 'vue-router';
44

55
export default defineComponent({
@@ -8,7 +8,9 @@ export default defineComponent({
88
<NConfigProvider locale={zhCN} dateLocale={dateZhCN}>
99
<NNotificationProvider>
1010
<NDialogProvider>
11-
<RouterView/>
11+
<NMessageProvider>
12+
<RouterView/>
13+
</NMessageProvider>
1214
</NDialogProvider>
1315
</NNotificationProvider>
1416
</NConfigProvider>

MaiChartManager/Front/src/components/MusicEdit/index.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { computed, defineComponent, onMounted, PropType, ref, watch } from "vue"
22
import { Chart, GenreXml, MusicXmlWithABJacket } from "@/client/apiGen";
33
import { addVersionList, genreList, selectedADir, selectedMusicBrief, selectMusicId, updateAddVersionList, updateGenreList, updateMusicList } from "@/store/refs";
44
import api from "@/client/api";
5-
import { NButton, NFlex, NForm, NFormItem, NInput, NInputNumber, NSelect, NTabPane, NTabs, SelectOption, useDialog } from "naive-ui";
5+
import { NButton, NFlex, NForm, NFormItem, NInput, NInputNumber, NSelect, NTabPane, NTabs, SelectOption, useDialog, useMessage } from "naive-ui";
66
import JacketBox from "./JacketBox";
77
import dxIcon from "@/assets/dxIcon.png";
88
import stdIcon from "@/assets/stdIcon.png";
@@ -12,23 +12,31 @@ import ProblemsDisplay from "@/components/ProblemsDisplay";
1212
import AcbAwb from "@/components/MusicEdit/AcbAwb";
1313
import GenreInput from "@/components/GenreInput";
1414
import VersionInput from "@/components/VersionInput";
15+
import { captureException } from "@sentry/vue"
1516

1617
const Component = defineComponent({
1718
setup() {
1819
const info = ref<MusicXmlWithABJacket | null>();
1920
const selectedLevel = ref(0);
21+
const message = useMessage();
2022

2123
onMounted(async () => {
2224
if (!selectMusicId.value) {
2325
info.value = null;
2426
return;
2527
}
26-
const response = await api.GetMusicDetail(selectMusicId.value);
27-
info.value = response.data;
2828

29-
const firstEnabledChart = info.value!.charts!.findIndex(chart => chart.enable);
30-
if (firstEnabledChart >= 0) {
31-
selectedLevel.value = firstEnabledChart;
29+
try {
30+
const response = await api.GetMusicDetail(selectMusicId.value);
31+
info.value = response.data;
32+
33+
const firstEnabledChart = info.value?.charts?.findIndex(chart => chart.enable);
34+
if (firstEnabledChart && firstEnabledChart >= 0) {
35+
selectedLevel.value = firstEnabledChart;
36+
}
37+
} catch (e: any) {
38+
message.error('加载歌曲信息失败');
39+
captureException(e.error || e);
3240
}
3341

3442
watch(() => info.value?.name, sync('name', api.EditMusicName));

MaiChartManager/Front/src/main.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ import './global.sass';
77
import posthog from "@/plugins/posthog";
88
import sentry from "@/plugins/sentry";
99

10-
let app = createApp(App)
11-
12-
if (import.meta.env.PROD) {
13-
app = app.use(posthog).use(sentry)
14-
}
15-
16-
app.use(router)
10+
createApp(App)
11+
.use(posthog)
12+
.use(sentry)
13+
.use(router)
1714
.mount('#app');

MaiChartManager/Front/src/plugins/sentry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ export default {
55
install(app: App) {
66
Sentry.init({
77
app,
8-
dsn: "https://74f5d24e699e0d069f69bad153c87059@o4507852801638400.ingest.de.sentry.io/4507852805374032",
8+
dsn: "https://[email protected]/2",
9+
environment: import.meta.env.DEV ? "development" : "production",
910
integrations: [
1011
Sentry.browserTracingIntegration(),
1112
Sentry.replayIntegration(),

MaiChartManager/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static void Main()
1414
SentrySdk.Init(o =>
1515
{
1616
// Tells which project in Sentry to send events to:
17-
o.Dsn = "https://[email protected].sentry.io/4507852868419664";
17+
o.Dsn = "https://be7a9ae3a9a88f4660737b25894b3c20@sentry.c5y.moe/3";
1818
// Set TracesSampleRate to 1.0 to capture 100% of transactions for tracing.
1919
// We recommend adjusting this value in production.
2020
o.TracesSampleRate = 0.5;

MaiChartManager/ServerManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public static void StartApp(bool export, Action? onStart = null)
6666
builder.WebHost.UseSentry((SentryAspNetCoreOptions o) =>
6767
{
6868
// Tells which project in Sentry to send events to:
69-
o.Dsn = "https://[email protected].sentry.io/4507852868419664";
69+
o.Dsn = "https://be7a9ae3a9a88f4660737b25894b3c20@sentry.c5y.moe/3";
7070
// Set TracesSampleRate to 1.0 to capture 100% of transactions for tracing.
7171
// We recommend adjusting this value in production.
7272
o.TracesSampleRate = 0.5;

Packaging/Pack/AppxManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4"
88
IgnorableNamespaces="win32dependencies"
99
>
10-
<Identity Name="22369479C5405.MaiChartManager" Publisher="CN=86A51452-7790-46C3-9A4B-1207C2C97940" Version="1.0.0.0"
10+
<Identity Name="22369479C5405.MaiChartManager" Publisher="CN=86A51452-7790-46C3-9A4B-1207C2C97940" Version="1.0.1.0"
1111
ProcessorArchitecture="x64" />
1212
<Properties>
1313
<DisplayName>MaiChartManager</DisplayName>

0 commit comments

Comments
 (0)