-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add diagnostics page with logs dump button
- Loading branch information
Showing
6 changed files
with
99 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<template> | ||
<v-card> | ||
<v-toolbar color="primary"> | ||
<v-avatar> | ||
<v-icon>bug_report</v-icon> | ||
</v-avatar> | ||
<v-toolbar-title>Diagnostics</v-toolbar-title> | ||
</v-toolbar> | ||
<v-list subheader three-line> | ||
<v-subheader | ||
>Diagnostics to provide bug reports to the developers of this software | ||
</v-subheader> | ||
|
||
<v-list-item v-if="hasAnonymousDiagnosticsToggleFeature"> | ||
<v-list-item-content> | ||
<v-list-item-title>Remote Sentry diagnostic reports:</v-list-item-title> | ||
<v-list-item-subtitle> | ||
<v-checkbox | ||
v-model="sentryDiagnosticsEnabled" | ||
label="Enable remote Sentry diagnostic reports" | ||
/> | ||
</v-list-item-subtitle> | ||
<v-list-item-subtitle> | ||
<v-btn color="primary" @click="saveSentryDiagnosticsSettings()"> | ||
<v-icon class="pr-2">save</v-icon> | ||
Save | ||
</v-btn> | ||
</v-list-item-subtitle> | ||
</v-list-item-content> | ||
</v-list-item> | ||
<v-divider /> | ||
<v-list-item> | ||
<v-list-item-content> | ||
<v-list-item-title>Logs Dump</v-list-item-title> | ||
<v-list-item-subtitle> | ||
Download a .zip file containing all logs from the server | ||
</v-list-item-subtitle> | ||
<v-list-item-subtitle> | ||
<br /> | ||
<v-btn color="primary" @click="downloadLogDump()"> | ||
<v-icon>download</v-icon> | ||
Download Log Files (.zip) | ||
</v-btn> | ||
</v-list-item-subtitle> | ||
</v-list-item-content> | ||
</v-list-item> | ||
</v-list> | ||
</v-card> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { onMounted, ref } from "vue"; | ||
import { AppService } from "../../backend/app.service"; | ||
import { useSettingsStore } from "../../store/settings.store"; | ||
import { SettingsService } from "../../backend"; | ||
import { setSentryEnabled } from "../../utils/sentry.util"; | ||
import { ServerPrivateService } from "../../backend/server-private.service"; | ||
const settingsStore = useSettingsStore(); | ||
const hasAnonymousDiagnosticsToggleFeature = ref(false); | ||
const sentryDiagnosticsEnabled = ref(false); | ||
onMounted(async () => { | ||
const features = await AppService.getFeatures(); | ||
hasAnonymousDiagnosticsToggleFeature.value = | ||
features.anonymousDiagnosticsToggle?.available || false; | ||
await settingsStore.loadSettings(); | ||
sentryDiagnosticsEnabled.value = settingsStore.serverSettings?.sentryDiagnosticsEnabled || false; | ||
}); | ||
async function saveSentryDiagnosticsSettings() { | ||
await SettingsService.setSentryDiagnosticsSettings(sentryDiagnosticsEnabled.value); | ||
setSentryEnabled(sentryDiagnosticsEnabled.value); | ||
} | ||
async function downloadLogDump() { | ||
await ServerPrivateService.downloadLogDump(); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters