Browse Source

refactor http export/import

Signed-off-by: ruiyi.jiang <ruiyi.jiang@zilliz.com>
ruiyi.jiang 1 year ago
parent
commit
ccef94ff86
35 changed files with 169 additions and 173 deletions
  1. 1 1
      client/src/components/layout/Header.tsx
  2. 1 1
      client/src/context/Auth.tsx
  3. 1 1
      client/src/context/Database.tsx
  4. 1 1
      client/src/context/Prometheus.tsx
  5. 1 1
      client/src/context/Root.tsx
  6. 1 3
      client/src/context/WebSocket.tsx
  7. 10 107
      client/src/http/Index.ts
  8. 107 0
      client/src/http/MilvusIndex.ts
  9. 1 1
      client/src/pages/collections/Aliases.tsx
  10. 1 2
      client/src/pages/collections/Collections.tsx
  11. 1 1
      client/src/pages/connect/AuthForm.tsx
  12. 1 1
      client/src/pages/database/Database.tsx
  13. 1 1
      client/src/pages/dialogs/CreateAliasDialog.tsx
  14. 1 1
      client/src/pages/dialogs/CreateCollectionDialog.tsx
  15. 1 1
      client/src/pages/dialogs/CreatePartitionDialog.tsx
  16. 1 1
      client/src/pages/dialogs/DropCollectionDialog.tsx
  17. 2 2
      client/src/pages/dialogs/DropPartitionDialog.tsx
  18. 1 2
      client/src/pages/dialogs/ImportSampleDialog.tsx
  19. 2 3
      client/src/pages/dialogs/LoadCollectionDialog.tsx
  20. 2 2
      client/src/pages/dialogs/ReleaseCollectionDialog.tsx
  21. 3 3
      client/src/pages/dialogs/RenameCollectionDialog.tsx
  22. 1 1
      client/src/pages/dialogs/insert/Dialog.tsx
  23. 1 2
      client/src/pages/overview/Overview.tsx
  24. 1 4
      client/src/pages/partitions/Partitions.tsx
  25. 4 6
      client/src/pages/preview/Preview.tsx
  26. 4 5
      client/src/pages/query/Query.tsx
  27. 6 6
      client/src/pages/schema/IndexTypeElement.tsx
  28. 1 2
      client/src/pages/schema/Schema.tsx
  29. 1 2
      client/src/pages/search/VectorSearch.tsx
  30. 2 2
      client/src/pages/system/SystemView.tsx
  31. 1 1
      client/src/pages/systemHealthy/SystemHealthyView.tsx
  32. 3 3
      client/src/pages/user/Roles.tsx
  33. 1 1
      client/src/pages/user/UpdateRoleDialog.tsx
  34. 1 1
      client/src/pages/user/UpdateUserRole.tsx
  35. 1 1
      client/src/pages/user/User.tsx

+ 1 - 1
client/src/components/layout/Header.tsx

@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
 import { makeStyles, Theme, createStyles, Typography } from '@material-ui/core';
 import { useNavigate } from 'react-router-dom';
 import { navContext, databaseContext, authContext } from '@/context';
-import { MilvusHttp } from '@/http/Milvus';
+import { MilvusHttp } from '@/http';
 import { MILVUS_ADDRESS } from '@/consts';
 import CustomSelector from '@/components/customSelector/CustomSelector';
 import icons from '../icons/Icons';

+ 1 - 1
client/src/context/Auth.tsx

@@ -1,6 +1,6 @@
 import { createContext, useEffect, useState } from 'react';
 import { MILVUS_ADDRESS } from '@/consts';
-import { MilvusHttp } from '@/http/Milvus';
+import { MilvusHttp } from '@/http';
 import { AuthContextType } from './Types';
 
 export const authContext = createContext<AuthContextType>({

+ 1 - 1
client/src/context/Database.tsx

@@ -1,5 +1,5 @@
 import { createContext, useEffect, useState } from 'react';
-import { DatabaseHttp } from '@/http/Database';
+import { DatabaseHttp } from '@/http';
 import { DatabaseContextType } from './Types';
 
 export const databaseContext = createContext<DatabaseContextType>({

+ 1 - 1
client/src/context/Prometheus.tsx

@@ -13,7 +13,7 @@ import {
   WITH_PROMETHEUS,
 } from '@/consts';
 import { formatPrometheusAddress } from '@/utils';
-import { PrometheusHttp } from '@/http/Prometheus';
+import { PrometheusHttp } from '@/http';
 
 export const prometheusContext = createContext<PrometheusContextType>({
   withPrometheus: false,

+ 1 - 1
client/src/context/Root.tsx

@@ -11,7 +11,7 @@ import {
 } from './Types';
 import CustomSnackBar from '@/components/customSnackBar/CustomSnackBar';
 import CustomDialog from '@/components/customDialog/CustomDialog';
-import { MilvusHttp } from '@/http/Milvus';
+import { MilvusHttp } from '@/http';
 import { theme } from '../styles/theme';
 
 const DefaultDialogConfigs: DialogType = {

+ 1 - 3
client/src/context/WebSocket.tsx

@@ -2,9 +2,7 @@ import { createContext, useContext, useEffect, useState, useRef } from 'react';
 import { io, Socket } from 'socket.io-client';
 import { WS_EVENTS, WS_EVENTS_TYPE } from '@/consts';
 import { authContext } from '@/context';
-import { url } from '@/http/Axios';
-import { CollectionHttp } from '@/http/Collection';
-import { MilvusHttp } from '@/http/Milvus';
+import { url, CollectionHttp, MilvusHttp } from '@/http';
 import { CollectionView } from '@/pages/collections/Types';
 import { checkIndexBuilding, checkLoading } from '@/utils';
 import { WebSocketType } from './Types';

+ 10 - 107
client/src/http/Index.ts

@@ -1,107 +1,10 @@
-import {
-  IndexCreateParam,
-  IndexManageParam,
-  IndexView,
-} from '../pages/schema/Types';
-import { ManageRequestMethods } from '../types/Common';
-import { IndexState } from '../types/Milvus';
-import { findKeyValue } from '../utils/Common';
-import { getKeyValueListFromJsonString } from '../utils/Format';
-import BaseModel from './BaseModel';
-
-export class IndexHttp extends BaseModel implements IndexView {
-  params!: { key: string; value: string }[];
-  field_name!: string;
-  index_name!: string;
-
-  constructor(props: {}) {
-    super(props);
-    Object.assign(this, props);
-  }
-
-  static BASE_URL = `/schema/index`;
-
-  static async getIndexStatus(
-    collectionName: string,
-    fieldName: string,
-    indexName: string
-  ): Promise<{ state: IndexState }> {
-    const path = `${this.BASE_URL}/state`;
-    return super.search({
-      path,
-      params: {
-        collection_name: collectionName,
-        field_name: fieldName,
-        index_name: indexName,
-      },
-    });
-  }
-
-  static async getIndexInfo(collectionName: string): Promise<IndexHttp[]> {
-    const path = this.BASE_URL;
-
-    const res = await super.findAll({
-      path,
-      params: { collection_name: collectionName },
-    });
-    return res.index_descriptions.map((index: any) => new this(index));
-  }
-
-  static async createIndex(param: IndexCreateParam) {
-    const path = this.BASE_URL;
-    const type: ManageRequestMethods = ManageRequestMethods.CREATE;
-
-    return super.create({
-      path,
-      data: { ...param, type },
-    });
-  }
-
-  static async deleteIndex(param: IndexManageParam) {
-    const path = this.BASE_URL;
-    const type: ManageRequestMethods = ManageRequestMethods.DELETE;
-
-    return super.batchDelete({ path, data: { ...param, type } });
-  }
-
-  static async getIndexBuildProgress(
-    collectionName: string,
-    fieldName: string,
-    indexName: string
-  ) {
-    const path = `${this.BASE_URL}/progress`;
-    return super.search({
-      path,
-      params: {
-        collection_name: collectionName,
-        field_name: fieldName,
-        index_name: indexName,
-      },
-    });
-  }
-
-  get _indexType() {
-    return this.params.find(p => p.key === 'index_type')?.value || '';
-  }
-  get _indexName() {
-    return this.index_name;
-  }
-
-  get _indexParameterPairs() {
-    const metricType = this.params.filter(v => v.key === 'metric_type');
-    // parms is json string, so we need parse it to key value array
-    const params = findKeyValue(this.params, 'params');
-    if (params) {
-      return [...metricType, ...getKeyValueListFromJsonString(params)];
-    }
-    return metricType;
-  }
-
-  get _fieldName() {
-    return this.field_name;
-  }
-
-  get _metricType() {
-    return this.params.find(p => p.key === 'metric_type')?.value || '';
-  }
-}
+export * from './Axios';
+export * from './BaseModel';
+export * from './Collection';
+export * from './Database';
+export * from './Milvus';
+export * from './MilvusIndex';
+export * from './Field';
+export * from './Partition';
+export * from './Prometheus';
+export * from './User';

+ 107 - 0
client/src/http/MilvusIndex.ts

@@ -0,0 +1,107 @@
+import {
+  IndexCreateParam,
+  IndexManageParam,
+  IndexView,
+} from '../pages/schema/Types';
+import { ManageRequestMethods } from '../types/Common';
+import { IndexState } from '../types/Milvus';
+import { findKeyValue } from '../utils/Common';
+import { getKeyValueListFromJsonString } from '../utils/Format';
+import BaseModel from './BaseModel';
+
+export class IndexHttp extends BaseModel implements IndexView {
+  params!: { key: string; value: string }[];
+  field_name!: string;
+  index_name!: string;
+
+  constructor(props: {}) {
+    super(props);
+    Object.assign(this, props);
+  }
+
+  static BASE_URL = `/schema/index`;
+
+  static async getIndexStatus(
+    collectionName: string,
+    fieldName: string,
+    indexName: string
+  ): Promise<{ state: IndexState }> {
+    const path = `${this.BASE_URL}/state`;
+    return super.search({
+      path,
+      params: {
+        collection_name: collectionName,
+        field_name: fieldName,
+        index_name: indexName,
+      },
+    });
+  }
+
+  static async getIndexInfo(collectionName: string): Promise<IndexHttp[]> {
+    const path = this.BASE_URL;
+
+    const res = await super.findAll({
+      path,
+      params: { collection_name: collectionName },
+    });
+    return res.index_descriptions.map((index: any) => new this(index));
+  }
+
+  static async createIndex(param: IndexCreateParam) {
+    const path = this.BASE_URL;
+    const type: ManageRequestMethods = ManageRequestMethods.CREATE;
+
+    return super.create({
+      path,
+      data: { ...param, type },
+    });
+  }
+
+  static async deleteIndex(param: IndexManageParam) {
+    const path = this.BASE_URL;
+    const type: ManageRequestMethods = ManageRequestMethods.DELETE;
+
+    return super.batchDelete({ path, data: { ...param, type } });
+  }
+
+  static async getIndexBuildProgress(
+    collectionName: string,
+    fieldName: string,
+    indexName: string
+  ) {
+    const path = `${this.BASE_URL}/progress`;
+    return super.search({
+      path,
+      params: {
+        collection_name: collectionName,
+        field_name: fieldName,
+        index_name: indexName,
+      },
+    });
+  }
+
+  get _indexType() {
+    return this.params.find(p => p.key === 'index_type')?.value || '';
+  }
+  get _indexName() {
+    return this.index_name;
+  }
+
+  get _indexParameterPairs() {
+    const metricType = this.params.filter(v => v.key === 'metric_type');
+    // parms is json string, so we need parse it to key value array
+    const params = findKeyValue(this.params, 'params');
+    if (params) {
+      return [...metricType, ...getKeyValueListFromJsonString(params)];
+    }
+    return metricType;
+  }
+
+  get _fieldName() {
+    return this.field_name;
+  }
+
+  get _metricType() {
+    return this.params.find(p => p.key === 'metric_type')?.value || '';
+  }
+}

+ 1 - 1
client/src/pages/collections/Aliases.tsx

@@ -7,7 +7,7 @@ import icons from '@/components/icons/Icons';
 import DeleteIcon from '@material-ui/icons/Delete';
 import CreateAliasDialog from '../dialogs/CreateAliasDialog';
 import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate';
-import { CollectionHttp } from '@/http/Collection';
+import { CollectionHttp } from '@/http';
 
 const useStyles = makeStyles((theme: Theme) => ({
   wrapper: {

+ 1 - 2
client/src/pages/collections/Collections.tsx

@@ -22,14 +22,13 @@ import { ChildrenStatusType } from '@/components/status/Types';
 import StatusIcon from '@/components/status/StatusIcon';
 import CustomToolTip from '@/components/customToolTip/CustomToolTip';
 import CreateCollectionDialog from '../dialogs/CreateCollectionDialog';
-import { CollectionHttp } from '@/http/Collection';
+import { CollectionHttp, MilvusHttp } from '@/http';
 import LoadCollectionDialog from '../dialogs/LoadCollectionDialog';
 import ReleaseCollectionDialog from '../dialogs/ReleaseCollectionDialog';
 import DropCollectionDialog from '../dialogs/DropCollectionDialog';
 import RenameCollectionDialog from '../dialogs/RenameCollectionDialog';
 import InsertDialog from '../dialogs/insert/Dialog';
 import ImportSampleDialog from '../dialogs/ImportSampleDialog';
-import { MilvusHttp } from '@/http/Milvus';
 import { LOADING_STATE, WS_EVENTS, WS_EVENTS_TYPE } from '@/consts';
 import { checkIndexBuilding, checkLoading } from '@/utils';
 import Aliases from './Aliases';

+ 1 - 1
client/src/pages/connect/AuthForm.tsx

@@ -7,7 +7,7 @@ import icons from '@/components/icons/Icons';
 import { ITextfieldConfig } from '@/components/customInput/Types';
 import { useFormValidation } from '@/hooks';
 import { formatForm } from '@/utils';
-import { MilvusHttp } from '@/http/Milvus';
+import { MilvusHttp } from '@/http';
 import { useNavigate } from 'react-router-dom';
 import { rootContext, authContext, prometheusContext } from '@/context';
 import { MILVUS_ADDRESS, LAST_TIME_ADDRESS, MILVUS_URL } from '@/consts';

+ 1 - 1
client/src/pages/database/Database.tsx

@@ -1,6 +1,6 @@
 import { useContext, useEffect, useState } from 'react';
 import { useTranslation } from 'react-i18next';
-import { DatabaseHttp } from '@/http/Database';
+import { DatabaseHttp } from '@/http';
 import AttuGrid from '@/components/grid/Grid';
 import { ColDefinitionsType, ToolBarConfig } from '@/components/grid/Types';
 import {

+ 1 - 1
client/src/pages/dialogs/CreateAliasDialog.tsx

@@ -7,7 +7,7 @@ import CustomInput from '@/components/customInput/CustomInput';
 import { formatForm } from '@/utils';
 import { useFormValidation } from '@/hooks';
 import { ITextfieldConfig } from '@/components/customInput/Types';
-import { CollectionHttp } from '@/http/Collection';
+import { CollectionHttp } from '@/http';
 import { CreateAliasProps } from './Types';
 
 const useStyles = makeStyles((theme: Theme) => ({

+ 1 - 1
client/src/pages/dialogs/CreateCollectionDialog.tsx

@@ -9,7 +9,7 @@ import { rootContext } from '@/context';
 import { useFormValidation } from '@/hooks';
 import { formatForm, TypeEnum } from '@/utils';
 import CreateFields from '../collections/CreateFields';
-import { CollectionHttp } from '@/http/Collection';
+import { CollectionHttp } from '@/http';
 import {
   CollectionCreateParam,
   CollectionCreateProps,

+ 1 - 1
client/src/pages/dialogs/CreatePartitionDialog.tsx

@@ -7,10 +7,10 @@ import CustomInput from '@/components/customInput/CustomInput';
 import { ITextfieldConfig } from '@/components/customInput/Types';
 import { useFormValidation } from '@/hooks';
 import { formatForm } from '@/utils';
+import { PartitionHttp } from '@/http';
 import { PartitionCreateProps } from './Types';
 import { PartitionManageParam } from '../partitions/Types';
 import { ManageRequestMethods } from '../../types/Common';
-import { PartitionHttp } from '@/http/Partition';
 
 const useStyles = makeStyles((theme: Theme) => ({
   input: {

+ 1 - 1
client/src/pages/dialogs/DropCollectionDialog.tsx

@@ -2,7 +2,7 @@ import { FC, useContext } from 'react';
 import { useTranslation } from 'react-i18next';
 import { rootContext } from '@/context';
 import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate';
-import { CollectionHttp } from '@/http/Collection';
+import { CollectionHttp } from '@/http';
 import { DropCollectionProps } from './Types';
 
 const DropCollectionDialog: FC<DropCollectionProps> = props => {

+ 2 - 2
client/src/pages/dialogs/DropPartitionDialog.tsx

@@ -2,10 +2,10 @@ import { FC, useContext } from 'react';
 import { useTranslation } from 'react-i18next';
 import { rootContext } from '@/context';
 import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate';
-import { DropPartitionProps } from './Types';
-import { PartitionHttp } from '@/http/Partition';
+import { PartitionHttp } from '@/http';
 import { PartitionManageParam } from '../partitions/Types';
 import { ManageRequestMethods } from '../../types/Common';
+import { DropPartitionProps } from './Types';
 
 const DropPartitionDialog: FC<DropPartitionProps> = props => {
   const { partitions, onDelete, collectionName } = props;

+ 1 - 2
client/src/pages/dialogs/ImportSampleDialog.tsx

@@ -5,8 +5,7 @@ import DialogTemplate from '@/components/customDialog/DialogTemplate';
 import CustomSelector from '@/components/customSelector/CustomSelector';
 import { rootContext } from '@/context';
 import { InsertStatusEnum } from './insert/Types';
-import { CollectionHttp } from '@/http/Collection';
-import { MilvusHttp } from '@/http/Milvus';
+import { CollectionHttp, MilvusHttp } from '@/http';
 import { LoadSampleParam } from './Types';
 
 const getStyles = makeStyles((theme: Theme) => {

+ 2 - 3
client/src/pages/dialogs/LoadCollectionDialog.tsx

@@ -8,15 +8,14 @@ import {
 } from '@material-ui/core';
 import { useTranslation } from 'react-i18next';
 import { authContext, rootContext } from '@/context';
-import { CollectionHttp } from '@/http/Collection';
+import { CollectionHttp, MilvusHttp } from '@/http';
 import { useFormValidation } from '@/hooks';
 import { formatForm, parseJson, getNode } from '@/utils';
+import { MILVUS_NODE_TYPE, MILVUS_DEPLOY_MODE } from '@/consts';
 import CustomInput from '@/components/customInput/CustomInput';
 import { ITextfieldConfig } from '@/components/customInput/Types';
 import DialogTemplate from '@/components/customDialog/DialogTemplate';
-import { MilvusHttp } from '@/http/Milvus';
 import CustomToolTip from '@/components/customToolTip/CustomToolTip';
-import { MILVUS_NODE_TYPE, MILVUS_DEPLOY_MODE } from '@/consts';
 import icons from '@/components/icons/Icons';
 
 const useStyles = makeStyles((theme: Theme) => ({

+ 2 - 2
client/src/pages/dialogs/ReleaseCollectionDialog.tsx

@@ -1,9 +1,9 @@
 import { useContext, useState } from 'react';
 import { Typography, makeStyles, Theme } from '@material-ui/core';
 import { useTranslation } from 'react-i18next';
-import { CollectionHttp } from '@/http/Collection';
-import { rootContext } from '@/context';
 import DialogTemplate from '@/components/customDialog/DialogTemplate';
+import { CollectionHttp } from '@/http';
+import { rootContext } from '@/context';
 
 const useStyles = makeStyles((theme: Theme) => ({
   desc: {

+ 3 - 3
client/src/pages/dialogs/RenameCollectionDialog.tsx

@@ -2,12 +2,12 @@ import { FC, useContext, useMemo, useState } from 'react';
 import { Typography, makeStyles, Theme } from '@material-ui/core';
 import { useTranslation } from 'react-i18next';
 import { rootContext } from '@/context';
-import DialogTemplate from '@/components/customDialog/DialogTemplate';
-import CustomInput from '@/components/customInput/CustomInput';
 import { formatForm } from '@/utils';
 import { useFormValidation } from '@/hooks';
+import { CollectionHttp } from '@/http';
+import DialogTemplate from '@/components/customDialog/DialogTemplate';
+import CustomInput from '@/components/customInput/CustomInput';
 import { ITextfieldConfig } from '@/components/customInput/Types';
-import { CollectionHttp } from '@/http/Collection';
 import { RenameCollectionProps } from './Types';
 
 const useStyles = makeStyles((theme: Theme) => ({

+ 1 - 1
client/src/pages/dialogs/insert/Dialog.tsx

@@ -14,7 +14,7 @@ import DialogTemplate from '@/components/customDialog/DialogTemplate';
 import icons from '@/components/icons/Icons';
 import { rootContext } from '@/context';
 import { Option } from '@/components/customSelector/Types';
-import { PartitionHttp } from '@/http/Partition';
+import { PartitionHttp } from '@/http';
 import { combineHeadsAndData } from '@/utils';
 import InsertImport from './Import';
 import InsertPreview from './Preview';

+ 1 - 2
client/src/pages/overview/Overview.tsx

@@ -6,8 +6,7 @@ import EmptyCard from '@/components/cards/EmptyCard';
 import icons from '@/components/icons/Icons';
 import { WS_EVENTS, WS_EVENTS_TYPE, LOADING_STATE } from '@/consts';
 import { useNavigationHook } from '@/hooks';
-import { CollectionHttp } from '@/http/Collection';
-import { MilvusHttp } from '@/http/Milvus';
+import { CollectionHttp, MilvusHttp } from '@/http';
 import { ALL_ROUTER_TYPES } from '@/router/Types';
 import { checkLoading, checkIndexBuilding, formatNumber } from '@/utils';
 import CollectionCard from './collectionCard/CollectionCard';

+ 1 - 4
client/src/pages/partitions/Partitions.tsx

@@ -9,13 +9,10 @@ import { usePaginationHook, useInsertDialogHook } from '@/hooks';
 import icons from '@/components/icons/Icons';
 import CustomToolTip from '@/components/customToolTip/CustomToolTip';
 import { rootContext } from '@/context';
-import { PartitionHttp } from '@/http/Partition';
+import { CollectionHttp, PartitionHttp, FieldHttp, MilvusHttp } from '@/http';
 import InsertContainer from '../dialogs/insert/Dialog';
-import { CollectionHttp } from '@/http/Collection';
-import { FieldHttp } from '@/http/Field';
 import { Field } from '../schema/Types';
 import { InsertDataParam } from '../collections/Types';
-import { MilvusHttp } from '@/http/Milvus';
 import CreatePartitionDialog from '../dialogs/CreatePartitionDialog';
 import DropPartitionDialog from '../dialogs/DropPartitionDialog';
 import { PartitionView } from './Types';

+ 4 - 6
client/src/pages/preview/Preview.tsx

@@ -1,16 +1,14 @@
 import { FC, useEffect, useState } from 'react';
 import { useTranslation } from 'react-i18next';
 import AttuGrid from '@/components/grid/Grid';
-import { getQueryStyles } from '../query/Styles';
-import { CollectionHttp } from '@/http/Collection';
-import { FieldHttp } from '@/http/Field';
-import { IndexHttp } from '@/http/Index';
+import { CollectionHttp, FieldHttp, IndexHttp } from '@/http';
 import { usePaginationHook, useSearchResult } from '@/hooks';
+import { generateVector } from '@/utils';
+import { INDEX_CONFIG, DEFAULT_SEARCH_PARAM_VALUE_MAP } from '@/consts';
 import { ToolBarConfig } from '@/components/grid/Types';
 import CustomToolBar from '@/components/grid/ToolBar';
-import { generateVector } from '@/utils';
 import { DataTypeEnum } from '@/pages/collections/Types';
-import { INDEX_CONFIG, DEFAULT_SEARCH_PARAM_VALUE_MAP } from '@/consts';
+import { getQueryStyles } from '../query/Styles';
 
 const Preview: FC<{
   collectionName: string;

+ 4 - 5
client/src/pages/query/Query.tsx

@@ -1,25 +1,24 @@
 import { FC, useEffect, useState, useRef, useContext } from 'react';
 import { TextField } from '@material-ui/core';
 import { useTranslation } from 'react-i18next';
+import { saveAs } from 'file-saver';
 import { Parser } from '@json2csv/plainjs';
 import { rootContext } from '@/context';
+import { CollectionHttp, FieldHttp } from '@/http';
+import { usePaginationHook, useSearchResult } from '@/hooks';
 import EmptyCard from '@/components/cards/EmptyCard';
 import icons from '@/components/icons/Icons';
 import CustomButton from '@/components/customButton/CustomButton';
 import AttuGrid from '@/components/grid/Grid';
 import { ToolBarConfig } from '@/components/grid/Types';
-import { saveAs } from 'file-saver';
-import { getQueryStyles } from './Styles';
 import Filter from '@/components/advancedSearch';
-import { CollectionHttp } from '@/http/Collection';
-import { FieldHttp } from '@/http/Field';
-import { usePaginationHook, useSearchResult } from '@/hooks';
 // import { useTimeTravelHook } from '@/hooks';
 import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate';
 import CustomToolBar from '@/components/grid/ToolBar';
 // import { CustomDatePicker } from '@/components/customDatePicker/CustomDatePicker';
 import { DataTypeStringEnum } from '../collections/Types';
 import { getLabelDisplayedRows } from '../search/Utils';
+import { getQueryStyles } from './Styles';
 
 const Query: FC<{
   collectionName: string;

+ 6 - 6
client/src/pages/schema/IndexTypeElement.tsx

@@ -1,22 +1,22 @@
 import { FC, useContext, useEffect, useMemo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
 import Chip from '@material-ui/core/Chip';
-import { IndexHttp } from '@/http/Index';
-import { IndexState } from '../../types/Milvus';
+import { makeStyles, Theme } from '@material-ui/core';
 import {
   FieldView,
   IndexCreateParam,
   IndexExtraParam,
   IndexManageParam,
 } from './Types';
-import { useTranslation } from 'react-i18next';
-import { makeStyles, Theme } from '@material-ui/core';
-import icons from '@/components/icons/Icons';
+import { IndexHttp } from '@/http';
 import { rootContext } from '@/context';
-import CreateIndex from './Create';
+import icons from '@/components/icons/Icons';
 import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate';
 import StatusIcon from '@/components/status/StatusIcon';
 import { ChildrenStatusType } from '@/components/status/Types';
 import { sleep } from '@/utils';
+import CreateIndex from './Create';
+import { IndexState } from '../../types/Milvus';
 
 const useStyles = makeStyles((theme: Theme) => ({
   wrapper: {

+ 1 - 2
client/src/pages/schema/Schema.tsx

@@ -5,10 +5,9 @@ import { ColDefinitionsType } from '@/components/grid/Types';
 import { useTranslation } from 'react-i18next';
 import { usePaginationHook } from '@/hooks';
 import icons from '@/components/icons/Icons';
-import { FieldHttp } from '@/http/Field';
+import { FieldHttp, IndexHttp } from '@/http';
 import { FieldView } from './Types';
 import IndexTypeElement from './IndexTypeElement';
-import { IndexHttp } from '@/http/Index';
 import { DataTypeStringEnum } from '../collections/Types';
 
 const useStyles = makeStyles((theme: Theme) => ({

+ 1 - 2
client/src/pages/search/VectorSearch.tsx

@@ -21,8 +21,7 @@ import { Option } from '@/components/customSelector/Types';
 import Filter from '@/components/advancedSearch';
 import { Field } from '@/components/advancedSearch/Types';
 import { CustomDatePicker } from '@/components/customDatePicker/CustomDatePicker';
-import { CollectionHttp } from '@/http/Collection';
-import { IndexHttp } from '@/http/Index';
+import { CollectionHttp, IndexHttp } from '@/http';
 import {
   parseValue,
   parseLocationSearch,

+ 2 - 2
client/src/pages/system/SystemView.tsx

@@ -4,13 +4,13 @@ import { makeStyles, Theme } from '@material-ui/core';
 import clsx from 'clsx';
 import { useNavigationHook, useInterval } from '@/hooks';
 import { ALL_ROUTER_TYPES } from '@/router/Types';
-import { MilvusHttp } from '@/http/Milvus';
+import { MilvusHttp } from '@/http';
+import { parseJson } from '@/utils';
 import Topo from './Topology';
 import NodeListView from './NodeListView';
 // import LineChartCard from './LineChartCard';
 // import ProgressCard from './ProgressCard';
 import DataCard from './DataCard';
-import { parseJson } from '@/utils';
 
 const getStyles = makeStyles((theme: Theme) => ({
   root: {

+ 1 - 1
client/src/pages/systemHealthy/SystemHealthyView.tsx

@@ -2,7 +2,7 @@ import { useEffect, useMemo, useState } from 'react';
 import { makeStyles, Theme } from '@material-ui/core';
 import { useTranslation } from 'react-i18next';
 import { useNavigationHook, useInterval } from '@/hooks';
-import { PrometheusHttp } from '@/http/Prometheus';
+import { PrometheusHttp } from '@/http';
 import { ALL_ROUTER_TYPES } from '@/router/Types';
 import {
   LAST_TIME_HEALTHY_THRESHOLD_CPU,

+ 3 - 3
client/src/pages/user/Roles.tsx

@@ -1,13 +1,13 @@
 import { useContext, useEffect, useState } from 'react';
 import { makeStyles, Theme, Chip } from '@material-ui/core';
 import { useTranslation } from 'react-i18next';
-import { UserHttp } from '@/http/User';
+import { UserHttp } from '@/http';
+import { rootContext } from '@/context';
+import { useNavigationHook } from '@/hooks';
 import AttuGrid from '@/components/grid/Grid';
 import { ColDefinitionsType, ToolBarConfig } from '@/components/grid/Types';
 import { DeleteRoleParams, RoleData } from './Types';
 import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate';
-import { rootContext } from '@/context';
-import { useNavigationHook } from '@/hooks';
 import { ALL_ROUTER_TYPES } from '@/router/Types';
 import UpdateRoleDialog from './UpdateRoleDialog';
 

+ 1 - 1
client/src/pages/user/UpdateRoleDialog.tsx

@@ -6,7 +6,7 @@ import CustomInput from '@/components/customInput/CustomInput';
 import { ITextfieldConfig } from '@/components/customInput/Types';
 import { useFormValidation } from '@/hooks';
 import { formatForm } from '@/utils';
-import { UserHttp } from '@/http/User';
+import { UserHttp } from '@/http';
 import {
   CreateRoleProps,
   CreateRoleParams,

+ 1 - 1
client/src/pages/user/UpdateUserRole.tsx

@@ -9,7 +9,7 @@ import { FC, useState, useEffect } from 'react';
 import { useTranslation } from 'react-i18next';
 import DialogTemplate from '@/components/customDialog/DialogTemplate';
 import { UpdateUserRoleProps, UpdateUserRoleParams } from './Types';
-import { UserHttp } from '@/http/User';
+import { UserHttp } from '@/http';
 
 const useStyles = makeStyles((theme: Theme) => ({
   input: {

+ 1 - 1
client/src/pages/user/User.tsx

@@ -1,7 +1,7 @@
 import React, { useContext, useEffect, useState } from 'react';
 import { makeStyles, Theme } from '@material-ui/core';
 import { useTranslation } from 'react-i18next';
-import { UserHttp } from '@/http/User';
+import { UserHttp } from '@/http';
 import AttuGrid from '@/components/grid/Grid';
 import { ColDefinitionsType, ToolBarConfig } from '@/components/grid/Types';
 import {