fix: panel breaking with advancedDebugInfo (#4952)

This commit is contained in:
Calum H.
2025-12-22 22:45:13 +00:00
committed by GitHub
parent 11a75e7657
commit 6a0bf5858e

View File

@@ -366,7 +366,7 @@
> >
<h2 class="m-0 text-lg font-extrabold text-contrast">Server data</h2> <h2 class="m-0 text-lg font-extrabold text-contrast">Server data</h2>
<pre class="markdown-body w-full overflow-auto rounded-2xl bg-bg-raised p-4 text-sm">{{ <pre class="markdown-body w-full overflow-auto rounded-2xl bg-bg-raised p-4 text-sm">{{
JSON.stringify(server, null, ' ') safeStringify(server)
}}</pre> }}</pre>
</div> </div>
</template> </template>
@@ -459,6 +459,24 @@ const errorTitle = ref('Error')
const errorMessage = ref('An unexpected error occurred.') const errorMessage = ref('An unexpected error occurred.')
const errorLog = ref('') const errorLog = ref('')
const errorLogFile = ref('') const errorLogFile = ref('')
function safeStringify(obj: unknown, indent = ' '): string {
const seen = new WeakSet()
return JSON.stringify(
obj,
(_key, value) => {
if (typeof value === 'object' && value !== null) {
if (seen.has(value)) {
return '[Circular]'
}
seen.add(value)
}
return value
},
indent,
)
}
const serverData = computed(() => server.general) const serverData = computed(() => server.general)
const isConnected = ref(false) const isConnected = ref(false)
const isWSAuthIncorrect = ref(false) const isWSAuthIncorrect = ref(false)