mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-31 08:22:00 +08:00
fix : parsing issue is fixed in the table view (#2693)
* fix: parsing is updated
This commit is contained in:
parent
df0502726d
commit
c7f09354f7
@ -89,7 +89,7 @@ function TableView({ logData }: TableViewProps): JSX.Element | null {
|
||||
if (!isEmpty(parsedBody)) {
|
||||
return (
|
||||
<Editor
|
||||
value={JSON.stringify(parsedBody, null, 2)}
|
||||
value={JSON.stringify(parsedBody, null, 2).replace(/\\n/g, '\n')}
|
||||
readOnly
|
||||
height="70vh"
|
||||
options={{
|
||||
|
@ -4,6 +4,15 @@ export const recursiveParseJSON = (obj: string): Record<string, unknown> => {
|
||||
if (typeof value === 'string') {
|
||||
return recursiveParseJSON(value);
|
||||
}
|
||||
if (typeof value === 'object') {
|
||||
Object.entries(value).forEach(([key, val]) => {
|
||||
if (typeof val === 'string') {
|
||||
value[key] = val.trim();
|
||||
} else if (typeof val === 'object') {
|
||||
value[key] = recursiveParseJSON(JSON.stringify(val));
|
||||
}
|
||||
});
|
||||
}
|
||||
return value;
|
||||
} catch (e) {
|
||||
return {};
|
||||
|
Loading…
x
Reference in New Issue
Block a user