mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-25 21:54:29 +08:00
feat: editor is updated in error details page
This commit is contained in:
parent
b335d440cf
commit
08e3428744
@ -5,13 +5,14 @@ function Editor({
|
||||
value,
|
||||
language = 'yaml',
|
||||
onChange,
|
||||
readOnly = false,
|
||||
}: EditorProps): JSX.Element {
|
||||
return (
|
||||
<MEditor
|
||||
theme="vs-dark"
|
||||
language={language}
|
||||
value={value}
|
||||
options={{ fontSize: 16, automaticLayout: true }}
|
||||
options={{ fontSize: 16, automaticLayout: true, readOnly }}
|
||||
height="40vh"
|
||||
onChange={(newValue): void => {
|
||||
if (newValue) {
|
||||
@ -26,10 +27,12 @@ interface EditorProps {
|
||||
value: string;
|
||||
language?: string;
|
||||
onChange: (value: string) => void;
|
||||
readOnly?: boolean;
|
||||
}
|
||||
|
||||
Editor.defaultProps = {
|
||||
language: undefined,
|
||||
readOnly: false,
|
||||
};
|
||||
|
||||
export default Editor;
|
||||
|
@ -2,7 +2,7 @@ import { Button, Divider, notification, Space, Table, Typography } from 'antd';
|
||||
import Editor from 'components/Editor';
|
||||
import dayjs from 'dayjs';
|
||||
import history from 'lib/history';
|
||||
import React, { useMemo, useRef, useState } from 'react';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { PayloadProps as GetByErrorTypeAndServicePayload } from 'types/api/errors/getByErrorTypeAndService';
|
||||
@ -21,7 +21,7 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
|
||||
|
||||
const errorDetail = idPayload;
|
||||
|
||||
const stackTraceValue = useRef(errorDetail.excepionStacktrace);
|
||||
const [stackTraceValue] = useState(errorDetail.excepionStacktrace);
|
||||
|
||||
const columns = useMemo(
|
||||
() => [
|
||||
@ -126,7 +126,6 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
|
||||
>
|
||||
{t('newer')}
|
||||
</Button>
|
||||
{/* <Button icon={<RightOutlined />} /> */}
|
||||
</Space>
|
||||
</div>
|
||||
</EventContainer>
|
||||
@ -139,7 +138,7 @@ function ErrorDetails(props: ErrorDetailsProps): JSX.Element {
|
||||
</DashedContainer>
|
||||
|
||||
<Typography.Title level={4}>{t('stack_trace')}</Typography.Title>
|
||||
<Editor value={stackTraceValue} readOnly />
|
||||
<Editor onChange={(): void => {}} value={stackTraceValue} readOnly />
|
||||
|
||||
<EditorContainer>
|
||||
<Space direction="vertical">
|
||||
|
Loading…
x
Reference in New Issue
Block a user