diff --git a/client/src/pages/collections/Types.ts b/client/src/pages/collections/Types.ts index 86b34883..38327f25 100644 --- a/client/src/pages/collections/Types.ts +++ b/client/src/pages/collections/Types.ts @@ -146,9 +146,3 @@ export enum TAB_EMUM { 'data-preview', 'data-query', } - -export interface LoadSampleParam { - collection_name: string; - // e.g. [{vector: [1,2,3], age: 10}] - size: string; -} diff --git a/client/src/pages/dialogs/ImportSampleDialog.tsx b/client/src/pages/dialogs/ImportSampleDialog.tsx index 3d24b29a..9e8b6c19 100644 --- a/client/src/pages/dialogs/ImportSampleDialog.tsx +++ b/client/src/pages/dialogs/ImportSampleDialog.tsx @@ -129,7 +129,7 @@ const ImportSampleDialog: FC<{ collection: string }> = props => { : insertStatus } handleConfirm={handleNext} - confirmDisabled={false} + confirmDisabled={insertStatus === InsertStatusEnum.loading} showActions={true} showCancel={false} // don't show close icon when insert not finish diff --git a/client/src/pages/dialogs/LoadCollectionDialog.tsx b/client/src/pages/dialogs/LoadCollectionDialog.tsx index 174a4fa8..80d2f19e 100644 --- a/client/src/pages/dialogs/LoadCollectionDialog.tsx +++ b/client/src/pages/dialogs/LoadCollectionDialog.tsx @@ -47,7 +47,7 @@ const LoadCollectionDialog = (props: any) => { const { t: warningTrans } = useTranslation('warning'); const { handleCloseDialog } = useContext(rootContext); const [form, setForm] = useState({ - replica: 0, + replica: 1, }); const [enableRelica, setEnableRelica] = useState(false); const [replicaToggle, setReplicaToggle] = useState(false); @@ -78,9 +78,6 @@ const LoadCollectionDialog = (props: any) => { // only show replica toggle in distributed mode && query node > 1 if (enableRelica && queryNodes.length > 1) { - setForm({ - replica: queryNodes.length, - }); setMaxQueryNode(queryNodes.length); setEnableRelica(enableRelica); } @@ -156,7 +153,7 @@ const LoadCollectionDialog = (props: any) => { const handleChange = () => { setReplicaToggle(!replicaToggle); if (!replicaToggle === false) { - setForm({ replica: 0 }); + setForm({ replica: 1 }); } }; diff --git a/client/src/pages/dialogs/Types.ts b/client/src/pages/dialogs/Types.ts index 843cf9e1..e3886ca0 100644 --- a/client/src/pages/dialogs/Types.ts +++ b/client/src/pages/dialogs/Types.ts @@ -25,4 +25,9 @@ export interface CreateAliasProps { export interface RenameCollectionProps { collectionName: string; cb?: () => void; -} \ No newline at end of file +} +export interface LoadSampleParam { + collection_name: string; + // e.g. [{vector: [1,2,3], age: 10}] + size: string; +}