in src/pr/FailureReport.js [70:104]
render() {
if (!this.state.text) {
return <Spin text={"Downloading logs"} />;
}
let height = 15;
return (
<Editor
height={`${height}em`}
defaultLanguage="logText"
defaultValue={this.state.text}
theme="logTheme"
beforeMount={(monaco) => {
const groupRanges = [];
registerLogLanguage(monaco, groupRanges);
}}
options={{
scrollBeyondLastLine: false,
lineNumbersMinChars: this.state.totalLines.toString().length + 1,
folding: true,
}}
onMount={(editor, monaco) => {
let foldAction = editor.getAction("editor.foldAll");
foldAction.run().then(() => {
let line = parseInt(
guessRelevantLine(this.state.text, this.state.totalLines) +
height / 2
);
editor.revealLine(line);
});
}}
loading={<Spin text={"Loading viewer"} />}
/>
);
}