fix issues

pull/410/head
vapao 2021-09-28 11:18:04 +08:00
parent 26b12a609b
commit 05ff30e33d
2 changed files with 5 additions and 2 deletions

View File

@ -20,9 +20,9 @@ export default observer(function (props) {
useEffect(() => {
if (!store.treeData.length) {
store.initial()
.then(() => setGroup(store.treeData[0]))
.then(() => setGroup(store.treeData[0] || {}))
} else {
setGroup(store.treeData[0])
setGroup(store.treeData[0] || {})
}
}, [])
@ -69,6 +69,7 @@ export default observer(function (props) {
if (props.oneGroup) setSelectedRowKeys([])
}
console.log(JSON.stringify(group))
return (
<Modal
visible={[undefined, true].includes(props.visible)}

View File

@ -30,6 +30,8 @@ export default function () {
requestStore.records = [];
requestStore.deploys = [];
hostStore.records = null;
hostStore.groups = {};
hostStore.treeData = [];
execStore.hosts = [];
}, [])