From a4945a9f6d54d2af11b8a61f6fc46da6cfce2456 Mon Sep 17 00:00:00 2001 From: vapao Date: Sun, 14 Jun 2020 18:34:20 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=BC=98=E5=8C=96=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E6=97=A5=E5=BF=97=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/pages/deploy/do/Ext1Index.js | 16 +++++++++++++--- spug_web/src/pages/deploy/do/Ext2Index.js | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/spug_web/src/pages/deploy/do/Ext1Index.js b/spug_web/src/pages/deploy/do/Ext1Index.js index e409900..2a24234 100644 --- a/spug_web/src/pages/deploy/do/Ext1Index.js +++ b/spug_web/src/pages/deploy/do/Ext1Index.js @@ -19,6 +19,7 @@ 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, @@ -56,7 +57,10 @@ class Ext1Index extends React.Component { _parse_message = (message) => { const {key, data, step, status} = message; - if (data !== undefined) store.outputs[key]['data'] += data; + if (data !== undefined) { + store.outputs[key]['data'] += data; + this.elements[key].scrollIntoView() + } if (step !== undefined) store.outputs[key]['step'] = step; if (status !== undefined) store.outputs[key]['status'] = status; }; @@ -139,7 +143,10 @@ class Ext1Index extends React.Component { }> -
{lds.get(store.outputs, 'local.data')}
+
+                {lds.get(store.outputs, 'local.data')}
+                
this.elements['local'] = el}/> +
@@ -158,7 +165,10 @@ class Ext1Index extends React.Component { }> -
{lds.get(store.outputs, `${item.id}.data`)}
+
+                  {lds.get(store.outputs, `${item.id}.data`)}
+                  
this.elements[item.id] = el} /> +
))} diff --git a/spug_web/src/pages/deploy/do/Ext2Index.js b/spug_web/src/pages/deploy/do/Ext2Index.js index 3671792..e55eca4 100644 --- a/spug_web/src/pages/deploy/do/Ext2Index.js +++ b/spug_web/src/pages/deploy/do/Ext2Index.js @@ -19,6 +19,7 @@ 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, @@ -57,7 +58,10 @@ class Ext1Index extends React.Component { _parse_message = (message) => { const {key, data, step, status} = message; - if (data !== undefined) store.outputs[key]['data'] += data; + if (data !== undefined) { + store.outputs[key]['data'] += data; + this.elements[key].scrollIntoView() + } if (step !== undefined) store.outputs[key]['step'] = step; if (status !== undefined) store.outputs[key]['status'] = status; }; @@ -140,7 +144,10 @@ class Ext1Index extends React.Component { ))} }> -
{lds.get(store.outputs, 'local.data')}
+
+                {lds.get(store.outputs, 'local.data')}
+                
this.elements['local'] = el}/> +
@@ -160,7 +167,10 @@ class Ext1Index extends React.Component { ))} }> -
{lds.get(store.outputs, `${item.id}.data`)}
+
+                    {lds.get(store.outputs, `${item.id}.data`)}
+                    
this.elements[item.id] = el}/> +
))}