mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-29 05:01:58 +08:00
fix: text wrap in log details view, remove json/raw tag (#5231)
This commit is contained in:
parent
a788230e70
commit
e6ee5fc9e3
@ -10,7 +10,7 @@ import { JSONViewProps } from './LogDetailedView.types';
|
||||
import { aggregateAttributesResourcesToString } from './utils';
|
||||
|
||||
function JSONView({ logData }: JSONViewProps): JSX.Element {
|
||||
const [isWrapWord, setIsWrapWord] = useState<boolean>(false);
|
||||
const [isWrapWord, setIsWrapWord] = useState<boolean>(true);
|
||||
|
||||
const LogJsonData = useMemo(
|
||||
() => aggregateAttributesResourcesToString(logData),
|
||||
@ -22,7 +22,7 @@ function JSONView({ logData }: JSONViewProps): JSX.Element {
|
||||
const options: EditorProps['options'] = {
|
||||
automaticLayout: true,
|
||||
readOnly: true,
|
||||
wordWrap: 'on',
|
||||
wordWrap: isWrapWord ? 'on' : 'off',
|
||||
minimap: {
|
||||
enabled: false,
|
||||
},
|
||||
@ -68,7 +68,7 @@ function JSONView({ logData }: JSONViewProps): JSX.Element {
|
||||
return (
|
||||
<div className="json-view-container">
|
||||
<MEditor
|
||||
value={isWrapWord ? JSON.stringify(LogJsonData) : LogJsonData}
|
||||
value={LogJsonData}
|
||||
language="json"
|
||||
options={options}
|
||||
onChange={(): void => {}}
|
||||
|
@ -35,7 +35,7 @@ function Overview({
|
||||
onClickActionItem,
|
||||
isListViewPanel = false,
|
||||
}: Props): JSX.Element {
|
||||
const [isWrapWord, setIsWrapWord] = useState<boolean>(false);
|
||||
const [isWrapWord, setIsWrapWord] = useState<boolean>(true);
|
||||
const [isSearchVisible, setIsSearchVisible] = useState<boolean>(false);
|
||||
const [isAttributesExpanded, setIsAttributesExpanded] = useState<boolean>(
|
||||
true,
|
||||
@ -48,7 +48,7 @@ function Overview({
|
||||
automaticLayout: true,
|
||||
readOnly: true,
|
||||
height: '40vh',
|
||||
wordWrap: 'on',
|
||||
wordWrap: isWrapWord ? 'on' : 'off',
|
||||
minimap: {
|
||||
enabled: false,
|
||||
},
|
||||
@ -118,8 +118,8 @@ function Overview({
|
||||
children: (
|
||||
<div className="logs-body-content">
|
||||
<MEditor
|
||||
value={isWrapWord ? JSON.stringify(logData.body) : logData.body}
|
||||
language={isWrapWord ? 'placetext' : 'json'}
|
||||
value={logData.body}
|
||||
language="json"
|
||||
options={options}
|
||||
onChange={(): void => {}}
|
||||
height="20vh"
|
||||
@ -143,7 +143,7 @@ function Overview({
|
||||
</div>
|
||||
</div>
|
||||
),
|
||||
extra: <Tag className="tag">{isWrapWord ? 'Raw' : 'JSON'}</Tag>,
|
||||
// extra: <Tag className="tag">JSON</Tag>,
|
||||
className: 'collapse-content',
|
||||
},
|
||||
]}
|
||||
|
Loading…
x
Reference in New Issue
Block a user