Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
WebUI dispatcher log / nnimanager log wrap (#3461)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lijiaoa authored Mar 24, 2021
1 parent 636ca9b commit f84d90d
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions ts/webui/src/components/public-child/MonacoEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as React from 'react';
import { Spinner } from '@fluentui/react';
import { DRAWEROPTION } from '../../static/const';
import MonacoEditor from 'react-monaco-editor';

interface MonacoEditorProps {
Expand All @@ -10,20 +9,10 @@ interface MonacoEditorProps {
}

class MonacoHTML extends React.Component<MonacoEditorProps, {}> {
public _isMonacoMount!: boolean;

constructor(props: MonacoEditorProps) {
super(props);
}

componentDidMount(): void {
this._isMonacoMount = true;
}

componentWillUnmount(): void {
this._isMonacoMount = false;
}

render(): React.ReactNode {
const { content, loading, height } = this.props;
return (
Expand All @@ -40,11 +29,27 @@ class MonacoHTML extends React.Component<MonacoEditorProps, {}> {
height={height}
language='json'
value={content}
options={DRAWEROPTION}
options={{
minimap: { enabled: false },
readOnly: true,
automaticLayout: true,
wordWrap: 'on'
}}
/>
</Spinner>
) : (
<MonacoEditor width='100%' height={height} language='json' value={content} options={DRAWEROPTION} />
<MonacoEditor
width='100%'
height={height}
language='json'
value={content}
options={{
minimap: { enabled: false },
readOnly: true,
automaticLayout: true,
wordWrap: 'on'
}}
/>
)}
</React.Fragment>
);
Expand Down

0 comments on commit f84d90d

Please sign in to comment.