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) {