diff --git a/spug_api/apps/deploy/views.py b/spug_api/apps/deploy/views.py
index 3941942..61f2490 100644
--- a/spug_api/apps/deploy/views.py
+++ b/spug_api/apps/deploy/views.py
@@ -179,8 +179,8 @@ class RequestDetailView(View):
return json_response(error='该申请单当前状态还不能执行发布')
hosts = Host.objects.filter(id__in=json.loads(req.host_ids))
token = uuid.uuid4().hex
- outputs = {str(x.id): {'data': ''} for x in hosts}
- outputs.update(local={'data': f'{human_time()} 建立接连... '})
+ outputs = {str(x.id): {'data': []} for x in hosts}
+ outputs.update(local={'data': [f'{human_time()} 建立接连... ']})
req.status = '2'
if not req.version:
req.version = f'{req.deploy_id}_{req.id}_{datetime.now().strftime("%Y%m%d%H%M%S")}'
diff --git a/spug_web/src/pages/deploy/do/Ext1Index.js b/spug_web/src/pages/deploy/do/Ext1Index.js
index 11bd303..11bf7a1 100644
--- a/spug_web/src/pages/deploy/do/Ext1Index.js
+++ b/spug_web/src/pages/deploy/do/Ext1Index.js
@@ -8,6 +8,7 @@ import { observer } from 'mobx-react';
import { Steps, Collapse, PageHeader, Spin, Tag, Button, Icon } from 'antd';
import http from 'libs/http';
import { AuthDiv } from 'components';
+import OutView from './OutView';
import history from 'libs/history';
import styles from './index.module.css';
import store from './store';
@@ -19,11 +20,9 @@ class Ext1Index extends React.Component {
super(props);
this.id = props.match.params.id;
this.log = props.match.params.log;
- this.elements = {};
this.state = {
fetching: true,
loading: false,
- request: {},
}
}
@@ -46,7 +45,7 @@ class Ext1Index extends React.Component {
while (res.outputs.length) {
const msg = JSON.parse(res.outputs.pop());
if (!outputs.hasOwnProperty(msg.key)) {
- const data = msg.key === 'local' ? '读取数据... ' : '';
+ const data = msg.key === 'local' ? ['读取数据... '] : [];
outputs[msg.key] = {data}
}
this._parse_message(msg, outputs)
@@ -60,9 +59,7 @@ class Ext1Index extends React.Component {
outputs = outputs || store.outputs;
const {key, data, step, status} = message;
if (data !== undefined) {
- outputs[key]['data'] += data;
- const el = this.elements[key];
- if (el) el.scrollTop = el.scrollHeight
+ outputs[key]['data'].push(data);
}
if (step !== undefined) outputs[key]['step'] = step;
if (status !== undefined) outputs[key]['status'] = status;
@@ -146,9 +143,7 @@ class Ext1Index extends React.Component {
this.elements['local'] = el} className={styles.ext1Console}> - {lds.get(store.outputs, 'local.data')} -+
this.elements[item.id] = el} className={styles.ext1Console}> - {lds.get(store.outputs, `${item.id}.data`)} -+
this.elements['local'] = el} className={styles.ext1Console}> - {lds.get(store.outputs, 'local.data')} -+
this.elements[item.id] = el} className={styles.ext1Console}> - {lds.get(store.outputs, `${item.id}.data`)} -+
this.el = el} className={styles.ext1Console}> + {this.props.outputs} ++ ) + } +} + +export default OutView \ No newline at end of file