From db268b7635ef80214f8d6301e8f688c3752af8a0 Mon Sep 17 00:00:00 2001 From: vapao Date: Mon, 27 Jun 2022 18:22:01 +0800 Subject: [PATCH] =?UTF-8?q?U=20=E4=B8=BB=E6=9C=BA=E5=88=86=E7=BB=845?= =?UTF-8?q?=E4=B8=AA=E4=BB=A5=E4=B8=8A=E6=97=B6=E4=B8=8D=E5=86=8D=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spug_web/src/pages/host/Group.js | 3 ++- spug_web/src/pages/host/Selector.js | 2 +- spug_web/src/pages/ssh/index.js | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spug_web/src/pages/host/Group.js b/spug_web/src/pages/host/Group.js index 37f16d7..6c1ab54 100644 --- a/spug_web/src/pages/host/Group.js +++ b/spug_web/src/pages/host/Group.js @@ -36,7 +36,8 @@ export default observer(function () { }, [loading]) useEffect(() => { - if (store.treeData.length > 0 && expands === undefined) { + const length = store.treeData.length + if (length > 0 && length < 5 && expands === undefined) { const tmp = store.treeData.filter(x => x.children.length) setExpands(tmp.map(x => x.key)) } diff --git a/spug_web/src/pages/host/Selector.js b/spug_web/src/pages/host/Selector.js index 3b57ab5..9fda5bd 100644 --- a/spug_web/src/pages/host/Selector.js +++ b/spug_web/src/pages/host/Selector.js @@ -95,7 +95,7 @@ export default observer(function (props) { 0 && store.treeData.length < 5} expandAction="doubleClick" selectedKeys={[group.key]} treeData={store.treeData} diff --git a/spug_web/src/pages/ssh/index.js b/spug_web/src/pages/ssh/index.js index cb92aaa..3302fbe 100644 --- a/spug_web/src/pages/ssh/index.js +++ b/spug_web/src/pages/ssh/index.js @@ -226,7 +226,7 @@ function WebSSH(props) {