ui: fix display

This commit is contained in:
undefined committed 2021-05-23 12:17:56 +08:00
1 parent 1d72362d49
commit fb102780aa
5 files changed
+5 -5

No files matched your search

@@ -14,7 +14,7 @@ export default function DataInputComponent(props) {
return (
<div {...rest} className={cn}>
{html // eslint-disable-next-line react/no-danger
? <div className="scratchpad__data-input" wrap="off" dangerouslySetInnerHTML={{ __html: value }} />
? <div className="scratchpad__data-input" wrap="off"><pre dangerouslySetInnerHTML={{ __html: value }} /></div>
: (
<textarea
className="scratchpad__data-input"
@@ -88,7 +88,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
componentWillUnmount() {
if (this.editor) this.editor.dispose();
if (this.model) this.model.dispose();
this.disposable.map((i) => i());
this.disposable.map((i) => i.dispose());
}
assignRef = (component) => {
@@ -40,7 +40,7 @@ const mapDispatchToProps = (dispatch) => ({
const req = request.post(UiContext.postPretestUrl, {
lang: props.editorLang,
code: props.editorCode,
input: props.pretestInput,
input: props.pretestInput || ' ',
});
dispatch({
type: 'SCRATCHPAD_POST_PRETEST',
@@ -15,7 +15,7 @@ export default function reducer(state = {
if (action.type === 'SCRATCHPAD_RECORDS_PUSH') {
const { rdoc } = action.payload;
if (rdoc._id === state.rid) {
const output = [`${STATUS_TEXTS[rdoc.status]} ${rdoc.time}ms ${rdoc.memory}MiB`];
const output = [`${STATUS_TEXTS[rdoc.status]} ${rdoc.time}ms ${rdoc.memory}KiB`];
if (rdoc.compilerTexts.length) output.push(rdoc.compilerTexts.join('\n'));
if (rdoc.testCases.length) output.push(rdoc.testCases[0].message || '');
return {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/ui-default",
"version": "4.8.42",
"version": "4.8.43",
"author": "undefined <i@undefined.moe>",
"license": "AGPL-3.0",
"main": "hydro.js",