From 7eafdf1f6109d590cd8ccf151fce25d5dd5dd422 Mon Sep 17 00:00:00 2001 From: vapao Date: Thu, 30 Jul 2020 18:36:49 +0800 Subject: [PATCH] =?UTF-8?q?A=20=E6=89=B9=E9=87=8F=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=96=B0=E5=A2=9E=E5=85=A8=E5=B1=8F?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/components/ACEditor.js | 1 - spug_web/src/pages/exec/task/ExecConsole.js | 12 +++++++++--- spug_web/src/pages/exec/task/OutView.js | 4 +++- spug_web/src/pages/exec/task/index.module.css | 18 +++++++++++++++++- spug_web/src/pages/exec/task/store.js | 1 + 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/spug_web/src/components/ACEditor.js b/spug_web/src/components/ACEditor.js index e799fd2..7709b0e 100644 --- a/spug_web/src/components/ACEditor.js +++ b/spug_web/src/components/ACEditor.js @@ -15,7 +15,6 @@ export default function (props) { { @@ -72,8 +73,13 @@ class ExecConsole extends React.Component { return ( 执行控制台, +
store.isFullscreen = !store.isFullscreen}> + +
+ ]} footer={null} onCancel={this.props.onCancel} onOk={this.handleSubmit} diff --git a/spug_web/src/pages/exec/task/OutView.js b/spug_web/src/pages/exec/task/OutView.js index d85ba5f..35894e9 100644 --- a/spug_web/src/pages/exec/task/OutView.js +++ b/spug_web/src/pages/exec/task/OutView.js @@ -7,6 +7,7 @@ import React from 'react'; import { toJS } from 'mobx'; import { observer } from 'mobx-react'; import styles from './index.module.css'; +import store from './store'; @observer class OutView extends React.Component { @@ -23,8 +24,9 @@ class OutView extends React.Component { render() { const outputs = toJS(this.props.outputs); + const maxHeight = store.isFullscreen ? 500 : 300; return ( -
this.el = ref} className={styles.console}> +
this.el = ref} className={styles.console} style={{maxHeight}}>
{outputs['system']}
{outputs['info']}
{outputs['error']}
diff --git a/spug_web/src/pages/exec/task/index.module.css b/spug_web/src/pages/exec/task/index.module.css index c128bca..1230594 100644 --- a/spug_web/src/pages/exec/task/index.module.css +++ b/spug_web/src/pages/exec/task/index.module.css @@ -2,8 +2,24 @@ padding: 0; } +.fullscreen { + position: absolute; + top: 0; + right: 0; + display: block; + width: 56px; + height: 56px; + line-height: 56px; + text-align: center; + cursor: pointer; + color: rgba(0, 0, 0, .45); + margin-right: 56px; +} +.fullscreen:hover { + color: #000; +} + .console { - max-height: 300px; padding: 10px 15px; overflow: scroll; } diff --git a/spug_web/src/pages/exec/task/store.js b/spug_web/src/pages/exec/task/store.js index 3a03e6b..d97db63 100644 --- a/spug_web/src/pages/exec/task/store.js +++ b/spug_web/src/pages/exec/task/store.js @@ -9,6 +9,7 @@ class Store { @observable outputs = {}; @observable hosts = []; @observable token = null; + @observable isFullscreen = false; @observable showHost = false; @observable showConsole = false; @observable showTemplate = false;