-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/** | ||
* Copyright (c) OpenSpug Organization. https://github.com/openspug/spug | ||
* Copyright (c) <[email protected]> | ||
* Released under the AGPL-3.0 License. | ||
*/ | ||
import React from 'react'; | ||
import { toJS } from 'mobx'; | ||
import { observer } from 'mobx-react'; | ||
import styles from './index.module.css'; | ||
|
||
@observer | ||
class OutView extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.el = null; | ||
} | ||
|
||
componentDidUpdate(prevProps, prevState, snapshot) { | ||
setTimeout(() => this.el.scrollTop = this.el.scrollHeight, 100) | ||
} | ||
|
||
render() { | ||
const outputs = toJS(this.props.outputs); | ||
return ( | ||
<div ref={ref => this.el = ref} className={styles.console}> | ||
<pre style={{color: '#91d5ff'}}>{outputs['system']}</pre> | ||
<pre>{outputs['info']}</pre> | ||
<pre style={{color: '#ffa39e'}}>{outputs['error']}</pre> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default OutView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
.console { | ||
max-height: 300px; | ||
padding: 10px 15px; | ||
overflow: scroll; | ||
} | ||
|
||
.header { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters