fix issues

pull/342/head
vapao 2021-06-18 15:11:22 +08:00
parent 4ad6476a11
commit eb5441f9a4
4 changed files with 4 additions and 6 deletions

View File

@ -26,7 +26,7 @@ export default observer(function () {
setHostIds(lds.clone(host_ids || app_host_ids)); setHostIds(lds.clone(host_ids || app_host_ids));
http.get('/api/repository/', {params: {deploy_id}}) http.get('/api/repository/', {params: {deploy_id}})
.then(res => setVersions(res)) .then(res => setVersions(res))
if (hostStore.records.length === 0) hostStore.fetchRecords() if (!hostStore.records || hostStore.records.length === 0) hostStore.fetchRecords()
}, []) }, [])
function handleSubmit() { function handleSubmit() {

View File

@ -26,7 +26,7 @@ export default observer(function () {
useEffect(() => { useEffect(() => {
const {app_host_ids, host_ids, extra} = store.record; const {app_host_ids, host_ids, extra} = store.record;
setHostIds(lds.clone(host_ids || app_host_ids)); setHostIds(lds.clone(host_ids || app_host_ids));
if (hostStore.records.length === 0) hostStore.fetchRecords(); if (!hostStore.records || hostStore.records.length === 0) hostStore.fetchRecords();
if (store.record.extra) setFileList([{...extra, uid: '0'}]) if (store.record.extra) setFileList([{...extra, uid: '0'}])
}, []) }, [])

View File

@ -29,7 +29,7 @@ export default function () {
appStore.records = []; appStore.records = [];
requestStore.records = []; requestStore.records = [];
requestStore.deploys = []; requestStore.deploys = [];
hostStore.records = []; hostStore.records = null;
execStore.hosts = []; execStore.hosts = [];
}, []) }, [])

View File

@ -16,9 +16,7 @@ import hostStore from '../host/store';
export default observer(function () { export default observer(function () {
useEffect(() => { useEffect(() => {
store.targets = store.record.id ? store.record['targets'] : [undefined]; store.targets = store.record.id ? store.record['targets'] : [undefined];
if (hostStore.records.length === 0) { if (!hostStore.records || hostStore.records.length === 0) hostStore.fetchRecords()
hostStore.fetchRecords()
}
}, []) }, [])
return ( return (
<Modal <Modal