From 09dc3ae3a8f70ced0ec3b5c957ba9c3d7bbea722 Mon Sep 17 00:00:00 2001 From: viown <48097677+viown@users.noreply.github.com> Date: Tue, 28 Oct 2025 12:38:45 +0300 Subject: [PATCH] Fix JSON in log viewer --- src/apps/dashboard/features/logs/api/useServerLog.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/apps/dashboard/features/logs/api/useServerLog.ts b/src/apps/dashboard/features/logs/api/useServerLog.ts index 21b2d10057..8adc37b501 100644 --- a/src/apps/dashboard/features/logs/api/useServerLog.ts +++ b/src/apps/dashboard/features/logs/api/useServerLog.ts @@ -12,7 +12,13 @@ const fetchServerLog = async ( const response = await getSystemApi(api).getLogFile({ name }, options); // FIXME: TypeScript SDK thinks it is returning a File but in reality it is a string - return response.data as never as string; + const data = response.data as never as string | object; + + if (typeof data === 'object') { + return JSON.stringify(data, null, 2); + } else { + return data; + } }; export const useServerLog = (name: string) => { const { api } = useApi();