fix: prerelease fixes (#5793)

This commit is contained in:
Calum H.
2026-04-13 01:58:50 +02:00
committed by GitHub
parent 0b8b4fb516
commit 0713814d0c
6 changed files with 178 additions and 112 deletions

View File

@@ -23,6 +23,14 @@
page. (WebSocket Authentication Failed)
</p>
</div>
<button
v-if="showAdvancedDebugInfo"
class="self-start rounded-lg bg-surface-3 px-3 py-1 text-sm text-contrast hover:brightness-125"
@click="downloadLog4jDebug"
>
Download WS debug JSON
</button>
</div>
</template>
@@ -37,6 +45,15 @@ import { injectModrinthClient, injectModrinthServerContext } from '#ui/providers
import ServerManageStats from './components/ServerManageStats.vue'
const props = withDefaults(
defineProps<{
showAdvancedDebugInfo?: boolean
}>(),
{
showAdvancedDebugInfo: false,
},
)
const client = injectModrinthClient()
const {
server: _serverData,
@@ -49,6 +66,14 @@ const {
} = injectModrinthServerContext()
const modrinthServersConsole = useModrinthServersConsole()
watch(
() => props.showAdvancedDebugInfo,
(enabled) => {
modrinthServersConsole.setWsEventCaptureEnabled(enabled)
},
{ immediate: true },
)
const crashAnalysis = ref<Mclogs.Insights.v1.InsightsResponse | null>(null)
const DISMISS_DURATION_MS = 30 * 60 * 1000
const dismissedUntil = useStorage(`modrinth-crash-dismissed-${serverId}`, 0)
@@ -120,4 +145,17 @@ watch(
if (serverPowerState.value === 'crashed') {
void inspectError()
}
const downloadLog4jDebug = () => {
const events = modrinthServersConsole.getWsEventHistory()
const blob = new Blob([JSON.stringify(events, null, 2)], { type: 'application/json' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = `ws-debug-${serverId}-${Date.now()}.json`
document.body.appendChild(a)
a.click()
document.body.removeChild(a)
URL.revokeObjectURL(url)
}
</script>