From 6a0bf5858e42cfe8aab96e6d80ae4157c7395fa3 Mon Sep 17 00:00:00 2001 From: "Calum H." Date: Mon, 22 Dec 2025 22:45:13 +0000 Subject: [PATCH] fix: panel breaking with advancedDebugInfo (#4952) --- .../src/pages/hosting/manage/[id].vue | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/frontend/src/pages/hosting/manage/[id].vue b/apps/frontend/src/pages/hosting/manage/[id].vue index af174464..caa8bc1d 100644 --- a/apps/frontend/src/pages/hosting/manage/[id].vue +++ b/apps/frontend/src/pages/hosting/manage/[id].vue @@ -366,7 +366,7 @@ >

Server data

{{
-			JSON.stringify(server, null, ' ')
+			safeStringify(server)
 		}}
@@ -459,6 +459,24 @@ const errorTitle = ref('Error') const errorMessage = ref('An unexpected error occurred.') const errorLog = 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 isConnected = ref(false) const isWSAuthIncorrect = ref(false)