Unverified Commit f84d90d6 authored by Lijiaoa's avatar Lijiaoa Committed by GitHub
Browse files

WebUI dispatcher log / nnimanager log wrap (#3461)

parent 636ca9b5
import * as React from 'react'; import * as React from 'react';
import { Spinner } from '@fluentui/react'; import { Spinner } from '@fluentui/react';
import { DRAWEROPTION } from '../../static/const';
import MonacoEditor from 'react-monaco-editor'; import MonacoEditor from 'react-monaco-editor';
interface MonacoEditorProps { interface MonacoEditorProps {
...@@ -10,20 +9,10 @@ interface MonacoEditorProps { ...@@ -10,20 +9,10 @@ interface MonacoEditorProps {
} }
class MonacoHTML extends React.Component<MonacoEditorProps, {}> { class MonacoHTML extends React.Component<MonacoEditorProps, {}> {
public _isMonacoMount!: boolean;
constructor(props: MonacoEditorProps) { constructor(props: MonacoEditorProps) {
super(props); super(props);
} }
componentDidMount(): void {
this._isMonacoMount = true;
}
componentWillUnmount(): void {
this._isMonacoMount = false;
}
render(): React.ReactNode { render(): React.ReactNode {
const { content, loading, height } = this.props; const { content, loading, height } = this.props;
return ( return (
...@@ -40,11 +29,27 @@ class MonacoHTML extends React.Component<MonacoEditorProps, {}> { ...@@ -40,11 +29,27 @@ class MonacoHTML extends React.Component<MonacoEditorProps, {}> {
height={height} height={height}
language='json' language='json'
value={content} value={content}
options={DRAWEROPTION} options={{
minimap: { enabled: false },
readOnly: true,
automaticLayout: true,
wordWrap: 'on'
}}
/> />
</Spinner> </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> </React.Fragment>
); );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment