mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: fix display
This commit is contained in:
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 (
|
return (
|
||||||
<div {...rest} className={cn}>
|
<div {...rest} className={cn}>
|
||||||
{html // eslint-disable-next-line react/no-danger
|
{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
|
<textarea
|
||||||
className="scratchpad__data-input"
|
className="scratchpad__data-input"
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(class MonacoEditor e
|
|||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
if (this.editor) this.editor.dispose();
|
if (this.editor) this.editor.dispose();
|
||||||
if (this.model) this.model.dispose();
|
if (this.model) this.model.dispose();
|
||||||
this.disposable.map((i) => i());
|
this.disposable.map((i) => i.dispose());
|
||||||
}
|
}
|
||||||
|
|
||||||
assignRef = (component) => {
|
assignRef = (component) => {
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
const req = request.post(UiContext.postPretestUrl, {
|
const req = request.post(UiContext.postPretestUrl, {
|
||||||
lang: props.editorLang,
|
lang: props.editorLang,
|
||||||
code: props.editorCode,
|
code: props.editorCode,
|
||||||
input: props.pretestInput,
|
input: props.pretestInput || ' ',
|
||||||
});
|
});
|
||||||
dispatch({
|
dispatch({
|
||||||
type: 'SCRATCHPAD_POST_PRETEST',
|
type: 'SCRATCHPAD_POST_PRETEST',
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default function reducer(state = {
|
|||||||
if (action.type === 'SCRATCHPAD_RECORDS_PUSH') {
|
if (action.type === 'SCRATCHPAD_RECORDS_PUSH') {
|
||||||
const { rdoc } = action.payload;
|
const { rdoc } = action.payload;
|
||||||
if (rdoc._id === state.rid) {
|
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.compilerTexts.length) output.push(rdoc.compilerTexts.join('\n'));
|
||||||
if (rdoc.testCases.length) output.push(rdoc.testCases[0].message || '');
|
if (rdoc.testCases.length) output.push(rdoc.testCases[0].message || '');
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/ui-default",
|
"name": "@hydrooj/ui-default",
|
||||||
"version": "4.8.42",
|
"version": "4.8.43",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"main": "hydro.js",
|
"main": "hydro.js",
|
||||||
|
|||||||
Reference in new issue
Block a user