mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-01 04:11:59 +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)) {
|
if (!isEmpty(parsedBody)) {
|
||||||
return (
|
return (
|
||||||
<Editor
|
<Editor
|
||||||
value={JSON.stringify(parsedBody, null, 2)}
|
value={JSON.stringify(parsedBody, null, 2).replace(/\\n/g, '\n')}
|
||||||
readOnly
|
readOnly
|
||||||
height="70vh"
|
height="70vh"
|
||||||
options={{
|
options={{
|
||||||
|
@ -4,6 +4,15 @@ export const recursiveParseJSON = (obj: string): Record<string, unknown> => {
|
|||||||
if (typeof value === 'string') {
|
if (typeof value === 'string') {
|
||||||
return recursiveParseJSON(value);
|
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;
|
return value;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return {};
|
return {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user