Browse Source

refactor consts export/import

Signed-off-by: ruiyi.jiang <ruiyi.jiang@zilliz.com>
ruiyi.jiang 1 year ago
parent
commit
8271ddcbff
38 changed files with 69 additions and 70 deletions
  1. 1 1
      client/src/components/__test__/status/Status.spec.tsx
  2. 2 2
      client/src/components/advancedSearch/Condition.tsx
  3. 1 2
      client/src/components/layout/GlobalEffect.tsx
  4. 1 1
      client/src/components/layout/Header.tsx
  5. 1 1
      client/src/components/status/Status.tsx
  6. 1 1
      client/src/components/status/Types.ts
  7. 1 1
      client/src/consts/Milvus.ts
  8. 0 0
      client/src/consts/Prometheus.ts
  9. 6 0
      client/src/consts/index.ts
  10. 1 1
      client/src/context/Auth.tsx
  11. 3 5
      client/src/context/Prometheus.tsx
  12. 1 1
      client/src/context/WebSocket.tsx
  13. 1 2
      client/src/http/Axios.ts
  14. 3 3
      client/src/http/Collection.ts
  15. 1 1
      client/src/http/Milvus.ts
  16. 4 4
      client/src/http/Partition.ts
  17. 1 2
      client/src/pages/collections/Collections.tsx
  18. 1 1
      client/src/pages/collections/Types.ts
  19. 1 3
      client/src/pages/connect/AuthForm.tsx
  20. 1 1
      client/src/pages/dialogs/LoadCollectionDialog.tsx
  21. 2 2
      client/src/pages/dialogs/insert/Import.tsx
  22. 1 2
      client/src/pages/overview/Overview.tsx
  23. 3 3
      client/src/pages/overview/collectionCard/CollectionCard.tsx
  24. 1 1
      client/src/pages/partitions/Types.ts
  25. 1 1
      client/src/pages/preview/Preview.tsx
  26. 1 1
      client/src/pages/schema/Create.tsx
  27. 2 2
      client/src/pages/schema/CreateForm.tsx
  28. 1 1
      client/src/pages/schema/Types.ts
  29. 1 1
      client/src/pages/search/SearchParams.tsx
  30. 1 1
      client/src/pages/search/Types.ts
  31. 1 2
      client/src/pages/search/VectorSearch.tsx
  32. 7 8
      client/src/pages/systemHealthy/SystemHealthyView.tsx
  33. 4 4
      client/src/types/SearchTypes.ts
  34. 1 1
      client/src/utils/Form.ts
  35. 6 3
      client/src/utils/Format.ts
  36. 1 1
      client/src/utils/Metric.ts
  37. 2 2
      client/src/utils/Validation.ts
  38. 1 1
      client/src/utils/__test__/Format.spec.ts

+ 1 - 1
client/src/components/__test__/status/Status.spec.tsx

@@ -1,5 +1,5 @@
 import Status from '../../status/Status';
 import Status from '../../status/Status';
-import { LOADING_STATE } from '../../../consts/Milvus';
+import { LOADING_STATE } from '@/consts';
 import { render, screen } from '@testing-library/react';
 import { render, screen } from '@testing-library/react';
 import { vi } from 'vitest';
 import { vi } from 'vitest';
 
 

+ 2 - 2
client/src/components/advancedSearch/Condition.tsx

@@ -9,8 +9,8 @@ import {
 import CloseIcon from '@material-ui/icons/Close';
 import CloseIcon from '@material-ui/icons/Close';
 import { ConditionProps, Field } from './Types';
 import { ConditionProps, Field } from './Types';
 import CustomSelector from '../customSelector/CustomSelector';
 import CustomSelector from '../customSelector/CustomSelector';
-import { LOGICAL_OPERATORS } from '../../consts/Util';
-import { DataTypeStringEnum } from '../../pages/collections/Types';
+import { LOGICAL_OPERATORS } from '@/consts';
+import { DataTypeStringEnum } from '@/pages/collections/Types';
 import { formatValue, checkValue } from './utils';
 import { formatValue, checkValue } from './utils';
 
 
 const Condition: FC<ConditionProps> = props => {
 const Condition: FC<ConditionProps> = props => {

+ 1 - 2
client/src/components/layout/GlobalEffect.tsx

@@ -1,8 +1,7 @@
 import React, { useContext } from 'react';
 import React, { useContext } from 'react';
 import axiosInstance from '@/http/Axios';
 import axiosInstance from '@/http/Axios';
 import { rootContext, authContext } from '@/context';
 import { rootContext, authContext } from '@/context';
-import { HTTP_STATUS_CODE } from '@/consts/Http';
-import { MILVUS_ADDRESS } from '@/consts/Localstorage';
+import { HTTP_STATUS_CODE, MILVUS_ADDRESS } from '@/consts';
 
 
 let axiosResInterceptor: number | null = null;
 let axiosResInterceptor: number | null = null;
 // let timer: Record<string, ReturnType<typeof setTimeout> | number>[] = [];
 // let timer: Record<string, ReturnType<typeof setTimeout> | number>[] = [];

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

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

+ 1 - 1
client/src/components/status/Status.tsx

@@ -8,7 +8,7 @@ import {
   Typography,
   Typography,
   useTheme,
   useTheme,
 } from '@material-ui/core';
 } from '@material-ui/core';
-import { LOADING_STATE } from '../../consts/Milvus';
+import { LOADING_STATE } from '@/consts';
 import StatusIcon from './StatusIcon';
 import StatusIcon from './StatusIcon';
 
 
 const useStyles = makeStyles((theme: Theme) =>
 const useStyles = makeStyles((theme: Theme) =>

+ 1 - 1
client/src/components/status/Types.ts

@@ -1,4 +1,4 @@
-import { LOADING_STATE } from '../../consts/Milvus';
+import { LOADING_STATE } from '@/consts';
 
 
 // export enum StatusEnum {
 // export enum StatusEnum {
 //   'unloaded',
 //   'unloaded',

+ 1 - 1
client/src/consts/Milvus.tsx → client/src/consts/Milvus.ts

@@ -1,4 +1,4 @@
-import { DataTypeEnum } from '../pages/collections/Types';
+import { DataTypeEnum } from '@/pages/collections/Types';
 
 
 export const MILVUS_URL =
 export const MILVUS_URL =
   ((window as any)._env_ && (window as any)._env_.MILVUS_URL) || '';
   ((window as any)._env_ && (window as any)._env_.MILVUS_URL) || '';

+ 0 - 0
client/src/consts/Prometheus.tsx → client/src/consts/Prometheus.ts


+ 6 - 0
client/src/consts/index.ts

@@ -0,0 +1,6 @@
+export * from './Http';
+export * from './Insert';
+export * from './Localstorage';
+export * from './Milvus';
+export * from './Prometheus';
+export * from './Util';

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

@@ -1,5 +1,5 @@
 import { createContext, useEffect, useState } from 'react';
 import { createContext, useEffect, useState } from 'react';
-import { MILVUS_ADDRESS } from '@/consts/Localstorage';
+import { MILVUS_ADDRESS } from '@/consts';
 import { MilvusHttp } from '@/http/Milvus';
 import { MilvusHttp } from '@/http/Milvus';
 import { AuthContextType } from './Types';
 import { AuthContextType } from './Types';
 
 

+ 3 - 5
client/src/context/Prometheus.tsx

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

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

@@ -1,6 +1,6 @@
 import { createContext, useContext, useEffect, useState, useRef } from 'react';
 import { createContext, useContext, useEffect, useState, useRef } from 'react';
 import { io, Socket } from 'socket.io-client';
 import { io, Socket } from 'socket.io-client';
-import { WS_EVENTS, WS_EVENTS_TYPE } from '@/consts/Http';
+import { WS_EVENTS, WS_EVENTS_TYPE } from '@/consts';
 import { authContext } from '@/context';
 import { authContext } from '@/context';
 import { url } from '@/http/Axios';
 import { url } from '@/http/Axios';
 import { CollectionHttp } from '@/http/Collection';
 import { CollectionHttp } from '@/http/Collection';

+ 1 - 2
client/src/http/Axios.ts

@@ -1,6 +1,5 @@
 import axios from 'axios';
 import axios from 'axios';
-import { MILVUS_ADDRESS } from '../consts/Localstorage';
-// import { SESSION } from '../consts/Localstorage';
+import { MILVUS_ADDRESS } from '@/consts';
 
 
 // console.log(import.meta.env.NODE_ENV, 'api:', import.meta.env.VITE_BASE_URL);
 // console.log(import.meta.env.NODE_ENV, 'api:', import.meta.env.VITE_BASE_URL);
 // console.log('docker env', (window as any)._env_);
 // console.log('docker env', (window as any)._env_);

+ 3 - 3
client/src/http/Collection.ts

@@ -7,15 +7,15 @@ import {
   Replica,
   Replica,
 } from '../pages/collections/Types';
 } from '../pages/collections/Types';
 import { LoadSampleParam } from '../pages/dialogs/Types';
 import { LoadSampleParam } from '../pages/dialogs/Types';
-import { Field } from '../pages/schema/Types';
+import { Field } from '@/pages/schema/Types';
 import { VectorSearchParam } from '../types/SearchTypes';
 import { VectorSearchParam } from '../types/SearchTypes';
-import { QueryParam } from '../pages/query/Types';
+import { QueryParam } from '@/pages/query/Types';
 import { IndexState, ShowCollectionsType } from '../types/Milvus';
 import { IndexState, ShowCollectionsType } from '../types/Milvus';
 import { formatNumber } from '../utils/Common';
 import { formatNumber } from '../utils/Common';
 import BaseModel from './BaseModel';
 import BaseModel from './BaseModel';
 import { FieldHttp } from './Field';
 import { FieldHttp } from './Field';
 import dayjs from 'dayjs';
 import dayjs from 'dayjs';
-import { LOADING_STATE } from '../consts/Milvus';
+import { LOADING_STATE } from '@/consts';
 
 
 export class CollectionHttp extends BaseModel implements CollectionView {
 export class CollectionHttp extends BaseModel implements CollectionView {
   private aliases!: string[];
   private aliases!: string[];

+ 1 - 1
client/src/http/Milvus.ts

@@ -1,4 +1,4 @@
-import { WS_EVENTS, WS_EVENTS_TYPE } from '../consts/Http';
+import { WS_EVENTS, WS_EVENTS_TYPE } from '@/consts';
 import BaseModel from './BaseModel';
 import BaseModel from './BaseModel';
 
 
 export class MilvusHttp extends BaseModel {
 export class MilvusHttp extends BaseModel {

+ 4 - 4
client/src/http/Partition.ts

@@ -1,11 +1,11 @@
 import dayjs from 'dayjs';
 import dayjs from 'dayjs';
-import { LOADING_STATE } from '../consts/Milvus';
+import { LOADING_STATE } from '@/consts';
 import {
 import {
   PartitionManageParam,
   PartitionManageParam,
   PartitionParam,
   PartitionParam,
   PartitionData,
   PartitionData,
-} from '../pages/partitions/Types';
-import { formatNumber } from '../utils/Common';
+} from '@/pages/partitions/Types';
+import { formatNumber } from '@/utils';
 import BaseModel from './BaseModel';
 import BaseModel from './BaseModel';
 
 
 export class PartitionHttp extends BaseModel implements PartitionData {
 export class PartitionHttp extends BaseModel implements PartitionData {
@@ -82,7 +82,7 @@ export class PartitionHttp extends BaseModel implements PartitionData {
 
 
   get _status() {
   get _status() {
     // @TODO replace mock data
     // @TODO replace mock data
-    return LOADING_STATE.UNLOADED
+    return LOADING_STATE.UNLOADED;
   }
   }
 
 
   // Befor milvus-2.0-rc3  will return '0'.
   // Befor milvus-2.0-rc3  will return '0'.

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

@@ -30,8 +30,7 @@ import RenameCollectionDialog from '../dialogs/RenameCollectionDialog';
 import InsertDialog from '../dialogs/insert/Dialog';
 import InsertDialog from '../dialogs/insert/Dialog';
 import ImportSampleDialog from '../dialogs/ImportSampleDialog';
 import ImportSampleDialog from '../dialogs/ImportSampleDialog';
 import { MilvusHttp } from '@/http/Milvus';
 import { MilvusHttp } from '@/http/Milvus';
-import { LOADING_STATE } from '@/consts/Milvus';
-import { WS_EVENTS, WS_EVENTS_TYPE } from '@/consts/Http';
+import { LOADING_STATE, WS_EVENTS, WS_EVENTS_TYPE } from '@/consts';
 import { checkIndexBuilding, checkLoading } from '@/utils';
 import { checkIndexBuilding, checkLoading } from '@/utils';
 import Aliases from './Aliases';
 import Aliases from './Aliases';
 
 

+ 1 - 1
client/src/pages/collections/Types.ts

@@ -1,6 +1,6 @@
 import { Dispatch, ReactElement, SetStateAction } from 'react';
 import { Dispatch, ReactElement, SetStateAction } from 'react';
 import { ChildrenStatusType } from '@/components/status/Types';
 import { ChildrenStatusType } from '@/components/status/Types';
-import { LOADING_STATE } from '../../consts/Milvus';
+import { LOADING_STATE } from '@/consts';
 import { FieldData } from '../schema/Types';
 import { FieldData } from '../schema/Types';
 
 
 export interface CollectionData {
 export interface CollectionData {

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

@@ -10,9 +10,7 @@ import { formatForm } from '@/utils';
 import { MilvusHttp } from '@/http/Milvus';
 import { MilvusHttp } from '@/http/Milvus';
 import { useNavigate } from 'react-router-dom';
 import { useNavigate } from 'react-router-dom';
 import { rootContext, authContext, prometheusContext } from '@/context';
 import { rootContext, authContext, prometheusContext } from '@/context';
-import {} from '@/context/Auth';
-import { MILVUS_ADDRESS, LAST_TIME_ADDRESS } from '@/consts/Localstorage';
-import { MILVUS_URL } from '@/consts/Milvus';
+import { MILVUS_ADDRESS, LAST_TIME_ADDRESS, MILVUS_URL } from '@/consts';
 import { CustomRadio } from '@/components/customRadio/CustomRadio';
 import { CustomRadio } from '@/components/customRadio/CustomRadio';
 
 
 const useStyles = makeStyles((theme: Theme) => ({
 const useStyles = makeStyles((theme: Theme) => ({

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

@@ -16,7 +16,7 @@ import { ITextfieldConfig } from '@/components/customInput/Types';
 import DialogTemplate from '@/components/customDialog/DialogTemplate';
 import DialogTemplate from '@/components/customDialog/DialogTemplate';
 import { MilvusHttp } from '@/http/Milvus';
 import { MilvusHttp } from '@/http/Milvus';
 import CustomToolTip from '@/components/customToolTip/CustomToolTip';
 import CustomToolTip from '@/components/customToolTip/CustomToolTip';
-import { MILVUS_NODE_TYPE, MILVUS_DEPLOY_MODE } from '@/consts/Milvus';
+import { MILVUS_NODE_TYPE, MILVUS_DEPLOY_MODE } from '@/consts';
 import icons from '@/components/icons/Icons';
 import icons from '@/components/icons/Icons';
 
 
 const useStyles = makeStyles((theme: Theme) => ({
 const useStyles = makeStyles((theme: Theme) => ({

+ 2 - 2
client/src/pages/dialogs/insert/Import.tsx

@@ -4,7 +4,7 @@ import { makeStyles, Theme, Divider, Typography } from '@material-ui/core';
 import CustomSelector from '@/components/customSelector/CustomSelector';
 import CustomSelector from '@/components/customSelector/CustomSelector';
 import { InsertImportProps } from './Types';
 import { InsertImportProps } from './Types';
 import Uploader from '@/components/uploader/Uploader';
 import Uploader from '@/components/uploader/Uploader';
-import { INSERT_CSV_SAMPLE, INSERT_MAX_SIZE } from '../../../consts/Insert';
+import { INSERT_MAX_SIZE } from '@/consts';
 import { parseByte } from '@/utils';
 import { parseByte } from '@/utils';
 
 
 const getStyles = makeStyles((theme: Theme) => ({
 const getStyles = makeStyles((theme: Theme) => ({
@@ -180,7 +180,7 @@ const InsertImport: FC<InsertImportProps> = ({
           {insertTrans('noteTitle')}
           {insertTrans('noteTitle')}
         </Typography>
         </Typography>
         <ul className="noteList">
         <ul className="noteList">
-          {insertTrans('notes').map(note => (
+          {insertTrans('notes').map((note: string) => (
             <li key={note} className="text noteItem">
             <li key={note} className="text noteItem">
               <Typography>{note}</Typography>
               <Typography>{note}</Typography>
             </li>
             </li>

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

@@ -4,8 +4,7 @@ import { useTranslation } from 'react-i18next';
 import { rootContext, webSocketContext, databaseContext } from '@/context';
 import { rootContext, webSocketContext, databaseContext } from '@/context';
 import EmptyCard from '@/components/cards/EmptyCard';
 import EmptyCard from '@/components/cards/EmptyCard';
 import icons from '@/components/icons/Icons';
 import icons from '@/components/icons/Icons';
-import { WS_EVENTS, WS_EVENTS_TYPE } from '@/consts/Http';
-import { LOADING_STATE } from '@/consts/Milvus';
+import { WS_EVENTS, WS_EVENTS_TYPE, LOADING_STATE } from '@/consts';
 import { useNavigationHook } from '@/hooks';
 import { useNavigationHook } from '@/hooks';
 import { CollectionHttp } from '@/http/Collection';
 import { CollectionHttp } from '@/http/Collection';
 import { MilvusHttp } from '@/http/Milvus';
 import { MilvusHttp } from '@/http/Milvus';

+ 3 - 3
client/src/pages/overview/collectionCard/CollectionCard.tsx

@@ -3,13 +3,13 @@ import { FC, useContext } from 'react';
 import CustomButton from '@/components/customButton/CustomButton';
 import CustomButton from '@/components/customButton/CustomButton';
 import icons from '@/components/icons/Icons';
 import icons from '@/components/icons/Icons';
 import Status from '@/components/status/Status';
 import Status from '@/components/status/Status';
-import { CollectionCardProps } from './Types';
 import { useTranslation } from 'react-i18next';
 import { useTranslation } from 'react-i18next';
 import CustomIconButton from '@/components/customButton/CustomIconButton';
 import CustomIconButton from '@/components/customButton/CustomIconButton';
 import { useNavigate, Link } from 'react-router-dom';
 import { useNavigate, Link } from 'react-router-dom';
-import { LOADING_STATE } from '@/consts/Milvus';
-import ReleaseCollectionDialog from '../../dialogs/ReleaseCollectionDialog';
+import { LOADING_STATE } from '@/consts';
 import { rootContext } from '@/context';
 import { rootContext } from '@/context';
+import ReleaseCollectionDialog from '../../dialogs/ReleaseCollectionDialog';
+import { CollectionCardProps } from './Types';
 
 
 const useStyles = makeStyles((theme: Theme) => ({
 const useStyles = makeStyles((theme: Theme) => ({
   wrapper: {
   wrapper: {

+ 1 - 1
client/src/pages/partitions/Types.ts

@@ -1,5 +1,5 @@
 import { ReactElement } from 'react';
 import { ReactElement } from 'react';
-import { LOADING_STATE } from '../../consts/Milvus';
+import { LOADING_STATE } from '@/consts';
 import { ManageRequestMethods } from '../../types/Common';
 import { ManageRequestMethods } from '../../types/Common';
 
 
 export interface PartitionData {
 export interface PartitionData {

+ 1 - 1
client/src/pages/preview/Preview.tsx

@@ -10,7 +10,7 @@ import { ToolBarConfig } from '@/components/grid/Types';
 import CustomToolBar from '@/components/grid/ToolBar';
 import CustomToolBar from '@/components/grid/ToolBar';
 import { generateVector } from '@/utils';
 import { generateVector } from '@/utils';
 import { DataTypeEnum } from '@/pages/collections/Types';
 import { DataTypeEnum } from '@/pages/collections/Types';
-import { INDEX_CONFIG, DEFAULT_SEARCH_PARAM_VALUE_MAP } from '@/consts/Milvus';
+import { INDEX_CONFIG, DEFAULT_SEARCH_PARAM_VALUE_MAP } from '@/consts';
 
 
 const Preview: FC<{
 const Preview: FC<{
   collectionName: string;
   collectionName: string;

+ 1 - 1
client/src/pages/schema/Create.tsx

@@ -9,7 +9,7 @@ import {
   INDEX_CONFIG,
   INDEX_CONFIG,
   INDEX_OPTIONS_MAP,
   INDEX_OPTIONS_MAP,
   METRIC_TYPES_VALUES,
   METRIC_TYPES_VALUES,
-} from '@/consts/Milvus';
+} from '@/consts';
 import { useFormValidation } from '@/hooks';
 import { useFormValidation } from '@/hooks';
 import { getCreateIndexJSCode } from '@/utils/code/Js';
 import { getCreateIndexJSCode } from '@/utils/code/Js';
 import { getCreateIndexPYCode } from '@/utils/code/Py';
 import { getCreateIndexPYCode } from '@/utils/code/Py';

+ 2 - 2
client/src/pages/schema/CreateForm.tsx

@@ -4,9 +4,9 @@ import { useTranslation } from 'react-i18next';
 import { ITextfieldConfig } from '@/components/customInput/Types';
 import { ITextfieldConfig } from '@/components/customInput/Types';
 import CustomInput from '@/components/customInput/CustomInput';
 import CustomInput from '@/components/customInput/CustomInput';
 import CustomSelector from '@/components/customSelector/CustomSelector';
 import CustomSelector from '@/components/customSelector/CustomSelector';
-import { m_OPTIONS } from '../../consts/Milvus';
-import { FormHelperType } from '../../types/Common';
 import { Option } from '@/components/customSelector/Types';
 import { Option } from '@/components/customSelector/Types';
+import { m_OPTIONS } from '@/consts';
+import { FormHelperType } from '../../types/Common';
 
 
 const useStyles = makeStyles((theme: Theme) => ({
 const useStyles = makeStyles((theme: Theme) => ({
   wrapper: {
   wrapper: {

+ 1 - 1
client/src/pages/schema/Types.ts

@@ -1,5 +1,5 @@
 import { ReactElement } from 'react';
 import { ReactElement } from 'react';
-import { MetricType } from '../../consts/Milvus';
+import { MetricType } from '@/consts';
 import { DataTypeStringEnum } from '../collections/Types';
 import { DataTypeStringEnum } from '../collections/Types';
 
 
 export enum INDEX_TYPES_ENUM {
 export enum INDEX_TYPES_ENUM {

+ 1 - 1
client/src/pages/search/SearchParams.tsx

@@ -11,7 +11,7 @@ import {
   INDEX_CONFIG,
   INDEX_CONFIG,
   METRIC_OPTIONS_MAP,
   METRIC_OPTIONS_MAP,
   searchKeywordsType,
   searchKeywordsType,
-} from '@/consts/Milvus';
+} from '@/consts';
 import { rootContext } from '@/context';
 import { rootContext } from '@/context';
 import { useFormValidation } from '@/hooks';
 import { useFormValidation } from '@/hooks';
 import { formatForm } from '@/utils';
 import { formatForm } from '@/utils';

+ 1 - 1
client/src/pages/search/Types.ts

@@ -1,5 +1,5 @@
 import { Option } from '@/components/customSelector/Types';
 import { Option } from '@/components/customSelector/Types';
-import { searchKeywordsType } from '../../consts/Milvus';
+import { searchKeywordsType } from '@/consts';
 import {
 import {
   DataTypeEnum,
   DataTypeEnum,
   DataTypeStringEnum,
   DataTypeStringEnum,

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

@@ -34,8 +34,7 @@ import {
   cloneObj,
   cloneObj,
   generateVector,
   generateVector,
 } from '@/utils';
 } from '@/utils';
-import { LOADING_STATE } from '@/consts/Milvus';
-import { DEFAULT_METRIC_VALUE_MAP } from '@/consts/Milvus';
+import { LOADING_STATE, DEFAULT_METRIC_VALUE_MAP } from '@/consts';
 import { getLabelDisplayedRows } from './Utils';
 import { getLabelDisplayedRows } from './Utils';
 import SearchParams from './SearchParams';
 import SearchParams from './SearchParams';
 import { getVectorSearchStyles } from './Styles';
 import { getVectorSearchStyles } from './Styles';

+ 7 - 8
client/src/pages/systemHealthy/SystemHealthyView.tsx

@@ -4,6 +4,12 @@ import { useTranslation } from 'react-i18next';
 import { useNavigationHook, useInterval } from '@/hooks';
 import { useNavigationHook, useInterval } from '@/hooks';
 import { PrometheusHttp } from '@/http/Prometheus';
 import { PrometheusHttp } from '@/http/Prometheus';
 import { ALL_ROUTER_TYPES } from '@/router/Types';
 import { ALL_ROUTER_TYPES } from '@/router/Types';
+import {
+  LAST_TIME_HEALTHY_THRESHOLD_CPU,
+  LAST_TIME_HEALTHY_THRESHOLD_MEMORY,
+  DEFAULT_HEALTHY_THRESHOLD_CPU,
+  DEFAULT_HEALTHY_THRESHOLD_MEMORY,
+} from '@/consts';
 import {
 import {
   ENodeService,
   ENodeService,
   ILineChartData,
   ILineChartData,
@@ -16,14 +22,7 @@ import Topology from './Topology';
 import { reconNodeTree } from './dataHandler';
 import { reconNodeTree } from './dataHandler';
 import HealthyIndexOverview from './HealthyIndexOverview';
 import HealthyIndexOverview from './HealthyIndexOverview';
 import { timeRangeOptions } from './consts';
 import { timeRangeOptions } from './consts';
-import {
-  LAST_TIME_HEALTHY_THRESHOLD_CPU,
-  LAST_TIME_HEALTHY_THRESHOLD_MEMORY,
-} from '@/consts/Localstorage';
-import {
-  DEFAULT_HEALTHY_THRESHOLD_CPU,
-  DEFAULT_HEALTHY_THRESHOLD_MEMORY,
-} from '@/consts/Prometheus';
+
 
 
 const getStyles = makeStyles((theme: Theme) => ({
 const getStyles = makeStyles((theme: Theme) => ({
   root: {
   root: {

+ 4 - 4
client/src/types/SearchTypes.ts

@@ -1,7 +1,7 @@
-import { Option } from '../components/customSelector/Types';
-import { searchKeywordsType } from '../consts/Milvus';
-import { DataTypeEnum, DataTypeStringEnum } from '../pages/collections/Types';
-import { IndexView } from '../pages/schema/Types';
+import { Option } from '@/components/customSelector/Types';
+import { searchKeywordsType } from '@/consts';
+import { DataTypeEnum, DataTypeStringEnum } from '@/pages/collections/Types';
+import { IndexView } from '@/pages/schema/Types';
 
 
 export interface SearchParamsProps {
 export interface SearchParamsProps {
   // if user created index, pass metric type choosed when creating
   // if user created index, pass metric type choosed when creating

+ 1 - 1
client/src/utils/Form.ts

@@ -1,5 +1,5 @@
 import { Option } from '@/components/customSelector/Types';
 import { Option } from '@/components/customSelector/Types';
-import { METRIC_TYPES_VALUES } from '@/consts/Milvus';
+import { METRIC_TYPES_VALUES } from '@/consts';
 import { IForm } from '@/hooks';
 import { IForm } from '@/hooks';
 import { DataTypeStringEnum } from '@/pages/collections/Types';
 import { DataTypeStringEnum } from '@/pages/collections/Types';
 import { IndexType } from '@/pages/schema/Types';
 import { IndexType } from '@/pages/schema/Types';

+ 6 - 3
client/src/utils/Format.ts

@@ -1,10 +1,13 @@
-import { BYTE_UNITS } from '../consts/Util';
-import { DEFAULT_MILVUS_PORT, DEFAULT_PROMETHEUS_PORT } from '../consts/Milvus';
+import {
+  BYTE_UNITS,
+  DEFAULT_MILVUS_PORT,
+  DEFAULT_PROMETHEUS_PORT,
+} from '@/consts';
 import {
 import {
   CreateFieldType,
   CreateFieldType,
   DataTypeEnum,
   DataTypeEnum,
   Field,
   Field,
-} from '../pages/collections/Types';
+} from '@/pages/collections/Types';
 
 
 /**
 /**
  * transform large capacity to capacity in b.
  * transform large capacity to capacity in b.

+ 1 - 1
client/src/utils/Metric.ts

@@ -1,4 +1,4 @@
-import { MILVUS_NODE_TYPE } from '../consts/Milvus';
+import { MILVUS_NODE_TYPE } from '@/consts';
 
 
 export const parseJson = (jsonData: any) => {
 export const parseJson = (jsonData: any) => {
   const nodes: any[] = [];
   const nodes: any[] = [];

+ 2 - 2
client/src/utils/Validation.ts

@@ -1,5 +1,5 @@
-import { ChildrenStatusType } from '../components/status/Types';
-import { MetricType, METRIC_TYPES_VALUES } from '../consts/Milvus';
+import { ChildrenStatusType } from '@/components/status/Types';
+import { MetricType, METRIC_TYPES_VALUES } from '@/consts';
 
 
 export type ValidType =
 export type ValidType =
   | 'email'
   | 'email'

+ 1 - 1
client/src/utils/__test__/Format.spec.ts

@@ -1,5 +1,5 @@
 import { parseByte } from '../Format';
 import { parseByte } from '../Format';
-import { BYTE_UNITS } from '../../consts/Util';
+import { BYTE_UNITS } from '@/consts';
 describe('Test Fromat utils', () => {
 describe('Test Fromat utils', () => {
   it('Test parse byte', () => {
   it('Test parse byte', () => {
     expect(parseByte('10m')).toEqual(10 * BYTE_UNITS.m);
     expect(parseByte('10m')).toEqual(10 * BYTE_UNITS.m);