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 @@ >
{{
- 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)