diff --git a/client/src/components/__test__/status/Status.spec.tsx b/client/src/components/__test__/status/Status.spec.tsx index b32c13e6..7cab4cbc 100644 --- a/client/src/components/__test__/status/Status.spec.tsx +++ b/client/src/components/__test__/status/Status.spec.tsx @@ -1,5 +1,5 @@ import Status from '../../status/Status'; -import { LOADING_STATE } from '../../../consts/Milvus'; +import { LOADING_STATE } from '@/consts'; import { render, screen } from '@testing-library/react'; import { vi } from 'vitest'; diff --git a/client/src/components/advancedSearch/Condition.tsx b/client/src/components/advancedSearch/Condition.tsx index 6f926c5b..2933dd97 100644 --- a/client/src/components/advancedSearch/Condition.tsx +++ b/client/src/components/advancedSearch/Condition.tsx @@ -9,8 +9,8 @@ import { import CloseIcon from '@material-ui/icons/Close'; import { ConditionProps, Field } from './Types'; 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'; const Condition: FC = props => { diff --git a/client/src/components/layout/GlobalEffect.tsx b/client/src/components/layout/GlobalEffect.tsx index ffca22af..92fce2e3 100644 --- a/client/src/components/layout/GlobalEffect.tsx +++ b/client/src/components/layout/GlobalEffect.tsx @@ -1,8 +1,7 @@ import React, { useContext } from 'react'; import axiosInstance from '@/http/Axios'; 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 timer: Record | number>[] = []; diff --git a/client/src/components/layout/Header.tsx b/client/src/components/layout/Header.tsx index b722df60..bdbe497f 100644 --- a/client/src/components/layout/Header.tsx +++ b/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 { navContext, databaseContext, authContext } from '@/context'; import { MilvusHttp } from '@/http/Milvus'; -import { MILVUS_ADDRESS } from '@/consts/Localstorage'; +import { MILVUS_ADDRESS } from '@/consts'; import CustomSelector from '@/components/customSelector/CustomSelector'; import icons from '../icons/Icons'; import { HeaderType } from './Types'; diff --git a/client/src/components/status/Status.tsx b/client/src/components/status/Status.tsx index f540677a..d0773f3a 100644 --- a/client/src/components/status/Status.tsx +++ b/client/src/components/status/Status.tsx @@ -8,7 +8,7 @@ import { Typography, useTheme, } from '@material-ui/core'; -import { LOADING_STATE } from '../../consts/Milvus'; +import { LOADING_STATE } from '@/consts'; import StatusIcon from './StatusIcon'; const useStyles = makeStyles((theme: Theme) => diff --git a/client/src/components/status/Types.ts b/client/src/components/status/Types.ts index c806c312..a30ff1d1 100644 --- a/client/src/components/status/Types.ts +++ b/client/src/components/status/Types.ts @@ -1,4 +1,4 @@ -import { LOADING_STATE } from '../../consts/Milvus'; +import { LOADING_STATE } from '@/consts'; // export enum StatusEnum { // 'unloaded', diff --git a/client/src/consts/Milvus.tsx b/client/src/consts/Milvus.ts similarity index 98% rename from client/src/consts/Milvus.tsx rename to client/src/consts/Milvus.ts index 9f220d13..2cfcac14 100644 --- a/client/src/consts/Milvus.tsx +++ b/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 = ((window as any)._env_ && (window as any)._env_.MILVUS_URL) || ''; diff --git a/client/src/consts/Prometheus.tsx b/client/src/consts/Prometheus.ts similarity index 100% rename from client/src/consts/Prometheus.tsx rename to client/src/consts/Prometheus.ts diff --git a/client/src/consts/index.ts b/client/src/consts/index.ts new file mode 100644 index 00000000..39781dd7 --- /dev/null +++ b/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'; diff --git a/client/src/context/Auth.tsx b/client/src/context/Auth.tsx index 853bd4ac..434b5df9 100644 --- a/client/src/context/Auth.tsx +++ b/client/src/context/Auth.tsx @@ -1,5 +1,5 @@ import { createContext, useEffect, useState } from 'react'; -import { MILVUS_ADDRESS } from '@/consts/Localstorage'; +import { MILVUS_ADDRESS } from '@/consts'; import { MilvusHttp } from '@/http/Milvus'; import { AuthContextType } from './Types'; diff --git a/client/src/context/Prometheus.tsx b/client/src/context/Prometheus.tsx index c3fdbe4d..28b139f3 100644 --- a/client/src/context/Prometheus.tsx +++ b/client/src/context/Prometheus.tsx @@ -7,15 +7,13 @@ import { LAST_TIME_PROMETHEUS_ADDRESS, LAST_TIME_PROMETHEUS_INSTANCE, LAST_TIME_PROMETHEUS_NAMESPACE, -} from '@/consts/Localstorage'; -import { formatPrometheusAddress } from '@/utils'; -import { PrometheusHttp } from '@/http/Prometheus'; -import { PROMETHEUS_ADDRESS, PROMETHEUS_INSTANCE_NAME, PROMETHEUS_NAMESPACE, WITH_PROMETHEUS, -} from '@/consts/Prometheus'; +} from '@/consts'; +import { formatPrometheusAddress } from '@/utils'; +import { PrometheusHttp } from '@/http/Prometheus'; export const prometheusContext = createContext({ withPrometheus: false, diff --git a/client/src/context/WebSocket.tsx b/client/src/context/WebSocket.tsx index 1bfd5b89..271d73c3 100644 --- a/client/src/context/WebSocket.tsx +++ b/client/src/context/WebSocket.tsx @@ -1,6 +1,6 @@ import { createContext, useContext, useEffect, useState, useRef } from 'react'; 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 { url } from '@/http/Axios'; import { CollectionHttp } from '@/http/Collection'; diff --git a/client/src/http/Axios.ts b/client/src/http/Axios.ts index fa9fe5d1..8af7949c 100644 --- a/client/src/http/Axios.ts +++ b/client/src/http/Axios.ts @@ -1,6 +1,5 @@ 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('docker env', (window as any)._env_); diff --git a/client/src/http/Collection.ts b/client/src/http/Collection.ts index b191bb44..1633d8aa 100644 --- a/client/src/http/Collection.ts +++ b/client/src/http/Collection.ts @@ -7,15 +7,15 @@ import { Replica, } from '../pages/collections/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 { QueryParam } from '../pages/query/Types'; +import { QueryParam } from '@/pages/query/Types'; import { IndexState, ShowCollectionsType } from '../types/Milvus'; import { formatNumber } from '../utils/Common'; import BaseModel from './BaseModel'; import { FieldHttp } from './Field'; import dayjs from 'dayjs'; -import { LOADING_STATE } from '../consts/Milvus'; +import { LOADING_STATE } from '@/consts'; export class CollectionHttp extends BaseModel implements CollectionView { private aliases!: string[]; diff --git a/client/src/http/Milvus.ts b/client/src/http/Milvus.ts index 03fbfd72..5c7da2d0 100644 --- a/client/src/http/Milvus.ts +++ b/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'; export class MilvusHttp extends BaseModel { diff --git a/client/src/http/Partition.ts b/client/src/http/Partition.ts index 8ed846e6..81378acb 100644 --- a/client/src/http/Partition.ts +++ b/client/src/http/Partition.ts @@ -1,11 +1,11 @@ import dayjs from 'dayjs'; -import { LOADING_STATE } from '../consts/Milvus'; +import { LOADING_STATE } from '@/consts'; import { PartitionManageParam, PartitionParam, PartitionData, -} from '../pages/partitions/Types'; -import { formatNumber } from '../utils/Common'; +} from '@/pages/partitions/Types'; +import { formatNumber } from '@/utils'; import BaseModel from './BaseModel'; export class PartitionHttp extends BaseModel implements PartitionData { @@ -82,7 +82,7 @@ export class PartitionHttp extends BaseModel implements PartitionData { get _status() { // @TODO replace mock data - return LOADING_STATE.UNLOADED + return LOADING_STATE.UNLOADED; } // Befor milvus-2.0-rc3 will return '0'. diff --git a/client/src/pages/collections/Collections.tsx b/client/src/pages/collections/Collections.tsx index 5d1d9662..ee3677aa 100644 --- a/client/src/pages/collections/Collections.tsx +++ b/client/src/pages/collections/Collections.tsx @@ -30,8 +30,7 @@ import RenameCollectionDialog from '../dialogs/RenameCollectionDialog'; import InsertDialog from '../dialogs/insert/Dialog'; import ImportSampleDialog from '../dialogs/ImportSampleDialog'; 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 Aliases from './Aliases'; diff --git a/client/src/pages/collections/Types.ts b/client/src/pages/collections/Types.ts index 057be784..d5066dc7 100644 --- a/client/src/pages/collections/Types.ts +++ b/client/src/pages/collections/Types.ts @@ -1,6 +1,6 @@ import { Dispatch, ReactElement, SetStateAction } from 'react'; import { ChildrenStatusType } from '@/components/status/Types'; -import { LOADING_STATE } from '../../consts/Milvus'; +import { LOADING_STATE } from '@/consts'; import { FieldData } from '../schema/Types'; export interface CollectionData { diff --git a/client/src/pages/connect/AuthForm.tsx b/client/src/pages/connect/AuthForm.tsx index e9b0c6d9..ec3af591 100644 --- a/client/src/pages/connect/AuthForm.tsx +++ b/client/src/pages/connect/AuthForm.tsx @@ -10,9 +10,7 @@ import { formatForm } from '@/utils'; import { MilvusHttp } from '@/http/Milvus'; import { useNavigate } from 'react-router-dom'; 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'; const useStyles = makeStyles((theme: Theme) => ({ diff --git a/client/src/pages/dialogs/LoadCollectionDialog.tsx b/client/src/pages/dialogs/LoadCollectionDialog.tsx index 64e8c4dc..b723709f 100644 --- a/client/src/pages/dialogs/LoadCollectionDialog.tsx +++ b/client/src/pages/dialogs/LoadCollectionDialog.tsx @@ -16,7 +16,7 @@ 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/Milvus'; +import { MILVUS_NODE_TYPE, MILVUS_DEPLOY_MODE } from '@/consts'; import icons from '@/components/icons/Icons'; const useStyles = makeStyles((theme: Theme) => ({ diff --git a/client/src/pages/dialogs/insert/Import.tsx b/client/src/pages/dialogs/insert/Import.tsx index cf7df3a3..30fbc571 100644 --- a/client/src/pages/dialogs/insert/Import.tsx +++ b/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 { InsertImportProps } from './Types'; 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'; const getStyles = makeStyles((theme: Theme) => ({ @@ -180,7 +180,7 @@ const InsertImport: FC = ({ {insertTrans('noteTitle')}
    - {insertTrans('notes').map(note => ( + {insertTrans('notes').map((note: string) => (
  • {note}
  • diff --git a/client/src/pages/overview/Overview.tsx b/client/src/pages/overview/Overview.tsx index 0ef18d0f..d21d6ca5 100644 --- a/client/src/pages/overview/Overview.tsx +++ b/client/src/pages/overview/Overview.tsx @@ -4,8 +4,7 @@ import { useTranslation } from 'react-i18next'; import { rootContext, webSocketContext, databaseContext } from '@/context'; import EmptyCard from '@/components/cards/EmptyCard'; 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 { CollectionHttp } from '@/http/Collection'; import { MilvusHttp } from '@/http/Milvus'; diff --git a/client/src/pages/overview/collectionCard/CollectionCard.tsx b/client/src/pages/overview/collectionCard/CollectionCard.tsx index bb4025bb..7e8db5e3 100644 --- a/client/src/pages/overview/collectionCard/CollectionCard.tsx +++ b/client/src/pages/overview/collectionCard/CollectionCard.tsx @@ -3,13 +3,13 @@ import { FC, useContext } from 'react'; import CustomButton from '@/components/customButton/CustomButton'; import icons from '@/components/icons/Icons'; import Status from '@/components/status/Status'; -import { CollectionCardProps } from './Types'; import { useTranslation } from 'react-i18next'; import CustomIconButton from '@/components/customButton/CustomIconButton'; 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 ReleaseCollectionDialog from '../../dialogs/ReleaseCollectionDialog'; +import { CollectionCardProps } from './Types'; const useStyles = makeStyles((theme: Theme) => ({ wrapper: { diff --git a/client/src/pages/partitions/Types.ts b/client/src/pages/partitions/Types.ts index 9daeb693..be1a365b 100644 --- a/client/src/pages/partitions/Types.ts +++ b/client/src/pages/partitions/Types.ts @@ -1,5 +1,5 @@ import { ReactElement } from 'react'; -import { LOADING_STATE } from '../../consts/Milvus'; +import { LOADING_STATE } from '@/consts'; import { ManageRequestMethods } from '../../types/Common'; export interface PartitionData { diff --git a/client/src/pages/preview/Preview.tsx b/client/src/pages/preview/Preview.tsx index d322e74b..0c06e841 100644 --- a/client/src/pages/preview/Preview.tsx +++ b/client/src/pages/preview/Preview.tsx @@ -10,7 +10,7 @@ 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/Milvus'; +import { INDEX_CONFIG, DEFAULT_SEARCH_PARAM_VALUE_MAP } from '@/consts'; const Preview: FC<{ collectionName: string; diff --git a/client/src/pages/schema/Create.tsx b/client/src/pages/schema/Create.tsx index 4cadf654..da9b3869 100644 --- a/client/src/pages/schema/Create.tsx +++ b/client/src/pages/schema/Create.tsx @@ -9,7 +9,7 @@ import { INDEX_CONFIG, INDEX_OPTIONS_MAP, METRIC_TYPES_VALUES, -} from '@/consts/Milvus'; +} from '@/consts'; import { useFormValidation } from '@/hooks'; import { getCreateIndexJSCode } from '@/utils/code/Js'; import { getCreateIndexPYCode } from '@/utils/code/Py'; diff --git a/client/src/pages/schema/CreateForm.tsx b/client/src/pages/schema/CreateForm.tsx index 54b54642..55aeb9a0 100644 --- a/client/src/pages/schema/CreateForm.tsx +++ b/client/src/pages/schema/CreateForm.tsx @@ -4,9 +4,9 @@ import { useTranslation } from 'react-i18next'; import { ITextfieldConfig } from '@/components/customInput/Types'; import CustomInput from '@/components/customInput/CustomInput'; import CustomSelector from '@/components/customSelector/CustomSelector'; -import { m_OPTIONS } from '../../consts/Milvus'; -import { FormHelperType } from '../../types/Common'; import { Option } from '@/components/customSelector/Types'; +import { m_OPTIONS } from '@/consts'; +import { FormHelperType } from '../../types/Common'; const useStyles = makeStyles((theme: Theme) => ({ wrapper: { diff --git a/client/src/pages/schema/Types.ts b/client/src/pages/schema/Types.ts index 766450ad..7457aa06 100644 --- a/client/src/pages/schema/Types.ts +++ b/client/src/pages/schema/Types.ts @@ -1,5 +1,5 @@ import { ReactElement } from 'react'; -import { MetricType } from '../../consts/Milvus'; +import { MetricType } from '@/consts'; import { DataTypeStringEnum } from '../collections/Types'; export enum INDEX_TYPES_ENUM { diff --git a/client/src/pages/search/SearchParams.tsx b/client/src/pages/search/SearchParams.tsx index 45f417aa..7f76be22 100644 --- a/client/src/pages/search/SearchParams.tsx +++ b/client/src/pages/search/SearchParams.tsx @@ -11,7 +11,7 @@ import { INDEX_CONFIG, METRIC_OPTIONS_MAP, searchKeywordsType, -} from '@/consts/Milvus'; +} from '@/consts'; import { rootContext } from '@/context'; import { useFormValidation } from '@/hooks'; import { formatForm } from '@/utils'; diff --git a/client/src/pages/search/Types.ts b/client/src/pages/search/Types.ts index 460bf99f..6636e611 100644 --- a/client/src/pages/search/Types.ts +++ b/client/src/pages/search/Types.ts @@ -1,5 +1,5 @@ import { Option } from '@/components/customSelector/Types'; -import { searchKeywordsType } from '../../consts/Milvus'; +import { searchKeywordsType } from '@/consts'; import { DataTypeEnum, DataTypeStringEnum, diff --git a/client/src/pages/search/VectorSearch.tsx b/client/src/pages/search/VectorSearch.tsx index a6ec7cf5..b8d6dca9 100644 --- a/client/src/pages/search/VectorSearch.tsx +++ b/client/src/pages/search/VectorSearch.tsx @@ -34,8 +34,7 @@ import { cloneObj, generateVector, } 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 SearchParams from './SearchParams'; import { getVectorSearchStyles } from './Styles'; diff --git a/client/src/pages/systemHealthy/SystemHealthyView.tsx b/client/src/pages/systemHealthy/SystemHealthyView.tsx index b7789cb3..80ed4480 100644 --- a/client/src/pages/systemHealthy/SystemHealthyView.tsx +++ b/client/src/pages/systemHealthy/SystemHealthyView.tsx @@ -4,6 +4,12 @@ import { useTranslation } from 'react-i18next'; import { useNavigationHook, useInterval } from '@/hooks'; import { PrometheusHttp } from '@/http/Prometheus'; 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 { ENodeService, ILineChartData, @@ -16,14 +22,7 @@ import Topology from './Topology'; import { reconNodeTree } from './dataHandler'; import HealthyIndexOverview from './HealthyIndexOverview'; 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) => ({ root: { diff --git a/client/src/types/SearchTypes.ts b/client/src/types/SearchTypes.ts index 935a22c4..080c17d7 100644 --- a/client/src/types/SearchTypes.ts +++ b/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 { // if user created index, pass metric type choosed when creating diff --git a/client/src/utils/Form.ts b/client/src/utils/Form.ts index c103ac32..59a72a8e 100644 --- a/client/src/utils/Form.ts +++ b/client/src/utils/Form.ts @@ -1,5 +1,5 @@ import { Option } from '@/components/customSelector/Types'; -import { METRIC_TYPES_VALUES } from '@/consts/Milvus'; +import { METRIC_TYPES_VALUES } from '@/consts'; import { IForm } from '@/hooks'; import { DataTypeStringEnum } from '@/pages/collections/Types'; import { IndexType } from '@/pages/schema/Types'; diff --git a/client/src/utils/Format.ts b/client/src/utils/Format.ts index 250c40f0..e40bf063 100644 --- a/client/src/utils/Format.ts +++ b/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 { CreateFieldType, DataTypeEnum, Field, -} from '../pages/collections/Types'; +} from '@/pages/collections/Types'; /** * transform large capacity to capacity in b. diff --git a/client/src/utils/Metric.ts b/client/src/utils/Metric.ts index 9638c4ee..2808ab70 100644 --- a/client/src/utils/Metric.ts +++ b/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) => { const nodes: any[] = []; diff --git a/client/src/utils/Validation.ts b/client/src/utils/Validation.ts index 3965403b..5c2d4641 100644 --- a/client/src/utils/Validation.ts +++ b/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 = | 'email' diff --git a/client/src/utils/__test__/Format.spec.ts b/client/src/utils/__test__/Format.spec.ts index 5a4dc694..e6e888b3 100644 --- a/client/src/utils/__test__/Format.spec.ts +++ b/client/src/utils/__test__/Format.spec.ts @@ -1,5 +1,5 @@ import { parseByte } from '../Format'; -import { BYTE_UNITS } from '../../consts/Util'; +import { BYTE_UNITS } from '@/consts'; describe('Test Fromat utils', () => { it('Test parse byte', () => { expect(parseByte('10m')).toEqual(10 * BYTE_UNITS.m);