Bläddra i källkod

reorg folders (#438)

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 1 år sedan
förälder
incheckning
694ca8c362
37 ändrade filer med 54 tillägg och 54 borttagningar
  1. 1 1
      client/src/context/Data.tsx
  2. 1 1
      client/src/context/Types.ts
  3. 3 3
      client/src/http/Collection.service.ts
  4. 1 1
      client/src/http/Data.service.ts
  5. 1 1
      client/src/http/Partition.service.ts
  6. 7 7
      client/src/pages/databases/Databases.tsx
  7. 1 1
      client/src/pages/databases/collections/Aliases.tsx
  8. 10 10
      client/src/pages/databases/collections/Collections.tsx
  9. 1 1
      client/src/pages/databases/collections/Constants.ts
  10. 0 0
      client/src/pages/databases/collections/CreateFields.tsx
  11. 0 0
      client/src/pages/databases/collections/StatusAction.tsx
  12. 0 0
      client/src/pages/databases/collections/Types.ts
  13. 6 6
      client/src/pages/databases/collections/data/Data.tsx
  14. 0 0
      client/src/pages/databases/collections/data/Styles.ts
  15. 0 0
      client/src/pages/databases/collections/data/Types.ts
  16. 0 0
      client/src/pages/databases/collections/overview/Create.tsx
  17. 1 1
      client/src/pages/databases/collections/overview/CreateForm.tsx
  18. 0 0
      client/src/pages/databases/collections/overview/IndexTypeElement.tsx
  19. 4 4
      client/src/pages/databases/collections/overview/Overview.tsx
  20. 0 0
      client/src/pages/databases/collections/overview/Types.ts
  21. 4 4
      client/src/pages/databases/collections/partitions/Partitions.tsx
  22. 1 1
      client/src/pages/databases/collections/partitions/Types.ts
  23. 2 2
      client/src/pages/databases/collections/segments/Segments.tsx
  24. 0 0
      client/src/pages/databases/collections/segments/Types.ts
  25. 3 3
      client/src/pages/dialogs/CreateCollectionDialog.tsx
  26. 1 1
      client/src/pages/dialogs/CreatePartitionDialog.tsx
  27. 1 1
      client/src/pages/dialogs/DropPartitionDialog.tsx
  28. 1 1
      client/src/pages/dialogs/insert/Dialog.tsx
  29. 0 0
      client/src/pages/home/DatabaseCard.tsx
  30. 0 0
      client/src/pages/home/Overview.tsx
  31. 0 0
      client/src/pages/home/SysCard.tsx
  32. 0 0
      client/src/pages/home/collectionCard/CollectionCard.tsx
  33. 0 0
      client/src/pages/home/collectionCard/Types.ts
  34. 1 1
      client/src/pages/index.tsx
  35. 1 1
      client/src/utils/Form.ts
  36. 1 1
      client/src/utils/Format.ts
  37. 1 1
      client/src/utils/code/Types.ts

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

@@ -9,7 +9,7 @@ import {
 import { io, Socket } from 'socket.io-client';
 import { authContext } from '@/context';
 import { url, CollectionService, MilvusService, DatabaseService } from '@/http';
-import { IndexCreateParam, IndexManageParam } from '@/pages/schema/Types';
+import { IndexCreateParam, IndexManageParam } from '@/pages/databases/collections/overview/Types';
 import { getDbValueFromUrl } from '@/utils';
 import { DataContextType } from './Types';
 import { LAST_TIME_DATABASE } from '@/consts';

+ 1 - 1
client/src/context/Types.ts

@@ -5,7 +5,7 @@ import {
   DatabaseObject,
 } from '@server/types';
 import { NavInfo } from '@/router/Types';
-import { IndexCreateParam, IndexManageParam } from '@/pages/schema/Types';
+import { IndexCreateParam, IndexManageParam } from '@/pages/databases/collections/overview/Types';
 
 export type RootContextType = {
   openSnackBar: OpenSnackBarType;

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

@@ -1,5 +1,5 @@
-import { LoadReplicaReq } from '@/pages/collections/Types';
-import { QueryParam } from '@/pages/query/Types';
+import { LoadReplicaReq } from '@/pages/databases/collections/Types';
+import { QueryParam } from '@/pages/databases/collections/data/Types';
 import BaseModel from './BaseModel';
 import {
   ShowCollectionsType,
@@ -12,7 +12,7 @@ import {
   IndexObject,
 } from '@server/types';
 import { ManageRequestMethods } from '../types/Common';
-import { IndexCreateParam, IndexManageParam } from '@/pages/schema/Types';
+import { IndexCreateParam, IndexManageParam } from '@/pages/databases/collections/overview/Types';
 
 export class CollectionService extends BaseModel {
   static getCollections(data?: {

+ 1 - 1
client/src/http/Data.service.ts

@@ -1,5 +1,5 @@
 import { LoadSampleParam } from '@/pages/dialogs/Types';
-import { InsertDataParam, DeleteEntitiesReq } from '@/pages/collections/Types';
+import { InsertDataParam, DeleteEntitiesReq } from '@/pages/databases/collections/Types';
 import { VectorSearchParam } from '@/types/SearchTypes';
 import BaseModel from './BaseModel';
 

+ 1 - 1
client/src/http/Partition.service.ts

@@ -1,4 +1,4 @@
-import { PartitionManageParam, PartitionParam } from '@/pages/partitions/Types';
+import { PartitionManageParam, PartitionParam } from '@/pages/databases/collections/partitions/Types';
 import BaseModel from './BaseModel';
 import { PartitionData } from '@server/types';
 

+ 7 - 7
client/src/pages/databases/Databases.tsx

@@ -7,12 +7,12 @@ import { ALL_ROUTER_TYPES } from '@/router/Types';
 import RouteTabList from '@/components/customTabList/RouteTabList';
 import DatabaseTree from '@/pages/databases/tree';
 import { ITab } from '@/components/customTabList/Types';
-import Partitions from '../partitions/Partitions';
-import Schema from '../schema/Schema';
-import Query from '../query/Query';
-import Segments from '../segments/Segments';
+import Partitions from './collections/partitions/Partitions';
+import Overview from './collections/overview/Overview';
+import Data from './collections/data/Data';
+import Segments from './collections/segments/Segments';
 import { dataContext, authContext } from '@/context';
-import Collections from '../collections/Collections';
+import Collections from './collections/Collections';
 import StatusIcon from '@/components/status/StatusIcon';
 import { ChildrenStatusType } from '@/components/status/Types';
 
@@ -73,12 +73,12 @@ const Databases = () => {
   const collectionTabs: ITab[] = [
     {
       label: collectionTrans('schemaTab'),
-      component: <Schema />,
+      component: <Overview />,
       path: `info`,
     },
     {
       label: collectionTrans('dataTab'),
-      component: <Query />,
+      component: <Data />,
       path: `data`,
     },
     {

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

@@ -3,7 +3,7 @@ import { Chip, IconButton, makeStyles, Theme } from '@material-ui/core';
 import { useTranslation } from 'react-i18next';
 import { rootContext, dataContext } from '@/context';
 import icons from '@/components/icons/Icons';
-import CreateAliasDialog from '../dialogs/CreateAliasDialog';
+import CreateAliasDialog from '../../dialogs/CreateAliasDialog';
 import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate';
 import { CollectionObject } from '@server/types';
 

+ 10 - 10
client/src/pages/collections/Collections.tsx → client/src/pages/databases/collections/Collections.tsx

@@ -12,17 +12,17 @@ import CustomToolBar from '@/components/grid/ToolBar';
 import { ColDefinitionsType, ToolBarConfig } from '@/components/grid/Types';
 import icons from '@/components/icons/Icons';
 import EmptyCard from '@/components/cards/EmptyCard';
-import StatusAction from '@/pages/collections/StatusAction';
+import StatusAction from '@/pages/databases/collections/StatusAction';
 import CustomToolTip from '@/components/customToolTip/CustomToolTip';
-import CreateCollectionDialog from '../dialogs/CreateCollectionDialog';
-import LoadCollectionDialog from '../dialogs/LoadCollectionDialog';
-import ReleaseCollectionDialog from '../dialogs/ReleaseCollectionDialog';
-import DropCollectionDialog from '../dialogs/DropCollectionDialog';
-import RenameCollectionDialog from '../dialogs/RenameCollectionDialog';
-import DuplicateCollectionDialog from '../dialogs/DuplicateCollectionDialog';
-import InsertDialog from '../dialogs/insert/Dialog';
-import ImportSampleDialog from '../dialogs/ImportSampleDialog';
-import { getLabelDisplayedRows } from '../search/Utils';
+import CreateCollectionDialog from '../../dialogs/CreateCollectionDialog';
+import LoadCollectionDialog from '../../dialogs/LoadCollectionDialog';
+import ReleaseCollectionDialog from '../../dialogs/ReleaseCollectionDialog';
+import DropCollectionDialog from '../../dialogs/DropCollectionDialog';
+import RenameCollectionDialog from '../../dialogs/RenameCollectionDialog';
+import DuplicateCollectionDialog from '../../dialogs/DuplicateCollectionDialog';
+import InsertDialog from '../../dialogs/insert/Dialog';
+import ImportSampleDialog from '../../dialogs/ImportSampleDialog';
+import { getLabelDisplayedRows } from '../../search/Utils';
 import { LOADING_STATE } from '@/consts';
 import { formatNumber } from '@/utils';
 import Aliases from './Aliases';

+ 1 - 1
client/src/pages/collections/Constants.ts → client/src/pages/databases/collections/Constants.ts

@@ -1,4 +1,4 @@
-import { LabelValuePair } from '../../types/Common';
+import { LabelValuePair } from '../../../types/Common';
 import { DataTypeEnum, ConsistencyLevelEnum } from '@/consts';
 
 export const CONSISTENCY_LEVEL_OPTIONS: LabelValuePair[] = [

+ 0 - 0
client/src/pages/collections/CreateFields.tsx → client/src/pages/databases/collections/CreateFields.tsx


+ 0 - 0
client/src/pages/collections/StatusAction.tsx → client/src/pages/databases/collections/StatusAction.tsx


+ 0 - 0
client/src/pages/collections/Types.ts → client/src/pages/databases/collections/Types.ts


+ 6 - 6
client/src/pages/query/Query.tsx → client/src/pages/databases/collections/data/Data.tsx

@@ -13,8 +13,8 @@ import { ToolBarConfig } from '@/components/grid/Types';
 import Filter from '@/components/advancedSearch';
 import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate';
 import CustomToolBar from '@/components/grid/ToolBar';
-import InsertDialog from '../dialogs/insert/Dialog';
-import { getLabelDisplayedRows } from '../search/Utils';
+import InsertDialog from '../../../dialogs/insert/Dialog';
+import { getLabelDisplayedRows } from '../../../search/Utils';
 import { getQueryStyles } from './Styles';
 import {
   DYNAMIC_FIELD,
@@ -23,11 +23,11 @@ import {
   ConsistencyLevelEnum,
 } from '@/consts';
 import CustomSelector from '@/components/customSelector/CustomSelector';
-import EmptyDataDialog from '../dialogs/EmptyDataDialog';
-import ImportSampleDialog from '../dialogs/ImportSampleDialog';
+import EmptyDataDialog from '../../../dialogs/EmptyDataDialog';
+import ImportSampleDialog from '../../../dialogs/ImportSampleDialog';
 import { detectItemType } from '@/utils';
 
-const Query = () => {
+const Data = () => {
   // get collection name from url
   const { collectionName = '' } = useParams<{ collectionName: string }>();
   // UI state
@@ -420,4 +420,4 @@ const Query = () => {
   );
 };
 
-export default Query;
+export default Data;

+ 0 - 0
client/src/pages/query/Styles.ts → client/src/pages/databases/collections/data/Styles.ts


+ 0 - 0
client/src/pages/query/Types.ts → client/src/pages/databases/collections/data/Types.ts


+ 0 - 0
client/src/pages/schema/Create.tsx → client/src/pages/databases/collections/overview/Create.tsx


+ 1 - 1
client/src/pages/schema/CreateForm.tsx → client/src/pages/databases/collections/overview/CreateForm.tsx

@@ -6,7 +6,7 @@ import CustomInput from '@/components/customInput/CustomInput';
 import CustomSelector from '@/components/customSelector/CustomSelector';
 import { Option } from '@/components/customSelector/Types';
 import { m_OPTIONS } from '@/consts';
-import { FormHelperType } from '../../types/Common';
+import { FormHelperType } from '../../../../types/Common';
 
 const useStyles = makeStyles((theme: Theme) => ({
   wrapper: {

+ 0 - 0
client/src/pages/schema/IndexTypeElement.tsx → client/src/pages/databases/collections/overview/IndexTypeElement.tsx


+ 4 - 4
client/src/pages/schema/Schema.tsx → client/src/pages/databases/collections/overview/Overview.tsx

@@ -14,11 +14,11 @@ import icons from '@/components/icons/Icons';
 import { formatFieldType } from '@/utils';
 import { rootContext, dataContext } from '@/context';
 import IndexTypeElement from './IndexTypeElement';
-import { getLabelDisplayedRows } from '../search/Utils';
+import { getLabelDisplayedRows } from '../../../search/Utils';
 import { LOADING_STATE } from '@/consts';
 import LoadCollectionDialog from '@/pages/dialogs/LoadCollectionDialog';
 import ReleaseCollectionDialog from '@/pages/dialogs/ReleaseCollectionDialog';
-import StatusAction from '@/pages/collections/StatusAction';
+import StatusAction from '@/pages/databases/collections/StatusAction';
 import CustomButton from '@/components/customButton/CustomButton';
 
 const useStyles = makeStyles((theme: Theme) => ({
@@ -113,7 +113,7 @@ const useStyles = makeStyles((theme: Theme) => ({
   },
 }));
 
-const Schema = () => {
+const Overview = () => {
   const { setDialog } = useContext(rootContext);
   const { fetchCollection, collections, loading } = useContext(dataContext);
   const { collectionName = '' } = useParams<{ collectionName: string }>();
@@ -385,4 +385,4 @@ const Schema = () => {
   );
 };
 
-export default Schema;
+export default Overview;

+ 0 - 0
client/src/pages/schema/Types.ts → client/src/pages/databases/collections/overview/Types.ts


+ 4 - 4
client/src/pages/partitions/Partitions.tsx → client/src/pages/databases/collections/partitions/Partitions.tsx

@@ -10,12 +10,12 @@ import icons from '@/components/icons/Icons';
 import CustomToolTip from '@/components/customToolTip/CustomToolTip';
 import { rootContext } from '@/context';
 import { CollectionService, PartitionService } from '@/http';
-import InsertContainer from '../dialogs/insert/Dialog';
-import CreatePartitionDialog from '../dialogs/CreatePartitionDialog';
-import DropPartitionDialog from '../dialogs/DropPartitionDialog';
+import InsertContainer from '../../../dialogs/insert/Dialog';
+import CreatePartitionDialog from '../../../dialogs/CreatePartitionDialog';
+import DropPartitionDialog from '../../../dialogs/DropPartitionDialog';
 import { PartitionData } from '@server/types';
 import { formatNumber } from '@/utils';
-import { getLabelDisplayedRows } from '../search/Utils';
+import { getLabelDisplayedRows } from '../../../search/Utils';
 
 const useStyles = makeStyles((theme: Theme) => ({
   wrapper: {

+ 1 - 1
client/src/pages/partitions/Types.ts → client/src/pages/databases/collections/partitions/Types.ts

@@ -1,6 +1,6 @@
 import { ReactElement } from 'react';
 import { LOADING_STATE } from '@/consts';
-import { ManageRequestMethods } from '../../types/Common';
+import { ManageRequestMethods } from '../../../../types/Common';
 
 // delete and create
 export interface PartitionManageParam {

+ 2 - 2
client/src/pages/segments/Segments.tsx → client/src/pages/databases/collections/segments/Segments.tsx

@@ -10,9 +10,9 @@ import { ToolBarConfig } from '@/components/grid/Types';
 import CustomToolBar from '@/components/grid/ToolBar';
 import CompactDialog from '@/pages/dialogs/CompactDialog';
 import FlushDialog from '@/pages/dialogs/FlushDialog';
-import { getQueryStyles } from '../query/Styles';
+import { getQueryStyles } from '../data/Styles';
 import { Segment } from './Types';
-import { getLabelDisplayedRows } from '../search/Utils';
+import { getLabelDisplayedRows } from '../../../search/Utils';
 
 const Segments = () => {
   const { collectionName = '' } = useParams<{ collectionName: string }>();

+ 0 - 0
client/src/pages/segments/Types.ts → client/src/pages/databases/collections/segments/Types.ts


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

@@ -14,13 +14,13 @@ import { rootContext, dataContext } from '@/context';
 import { useFormValidation } from '@/hooks';
 import { formatForm, TypeEnum } from '@/utils';
 import { DataTypeEnum, ConsistencyLevelEnum, DEFAULT_ATTU_DIM } from '@/consts';
-import CreateFields from '../collections/CreateFields';
+import CreateFields from '../databases/collections/CreateFields';
 import {
   CollectionCreateParam,
   CollectionCreateProps,
   CreateField,
-} from '../collections/Types';
-import { CONSISTENCY_LEVEL_OPTIONS } from '../collections/Constants';
+} from '../databases/collections/Types';
+import { CONSISTENCY_LEVEL_OPTIONS } from '../databases/collections/Constants';
 
 const useStyles = makeStyles((theme: Theme) => ({
   fieldset: {

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

@@ -9,7 +9,7 @@ import { useFormValidation } from '@/hooks';
 import { formatForm } from '@/utils';
 import { PartitionService } from '@/http';
 import { PartitionCreateProps } from './Types';
-import { PartitionManageParam } from '../partitions/Types';
+import { PartitionManageParam } from '../databases/collections/partitions/Types';
 import { ManageRequestMethods } from '../../types/Common';
 
 const useStyles = makeStyles((theme: Theme) => ({

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

@@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
 import { rootContext } from '@/context';
 import DeleteTemplate from '@/components/customDialog/DeleteDialogTemplate';
 import { PartitionService } from '@/http';
-import { PartitionManageParam } from '../partitions/Types';
+import { PartitionManageParam } from '../databases/collections/partitions/Types';
 import { ManageRequestMethods } from '../../types/Common';
 import { DropPartitionProps } from './Types';
 

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

@@ -25,7 +25,7 @@ import {
   InsertStatusEnum,
   InsertStepperEnum,
 } from './Types';
-import { InsertDataParam } from '@/pages/collections/Types';
+import { InsertDataParam } from '@/pages/databases/collections/Types';
 import { DataService } from '@/http';
 
 const getStyles = makeStyles((theme: Theme) => ({

+ 0 - 0
client/src/pages/overview/DatabaseCard.tsx → client/src/pages/home/DatabaseCard.tsx


+ 0 - 0
client/src/pages/overview/Overview.tsx → client/src/pages/home/Overview.tsx


+ 0 - 0
client/src/pages/overview/SysCard.tsx → client/src/pages/home/SysCard.tsx


+ 0 - 0
client/src/pages/overview/collectionCard/CollectionCard.tsx → client/src/pages/home/collectionCard/CollectionCard.tsx


+ 0 - 0
client/src/pages/overview/collectionCard/Types.ts → client/src/pages/home/collectionCard/Types.ts


+ 1 - 1
client/src/pages/index.tsx

@@ -13,7 +13,7 @@ import {
   prometheusContext,
   dataContext,
 } from '@/context';
-import Overview from '@/pages/overview/Overview';
+import Overview from '@/pages/home/Overview';
 
 const useStyles = makeStyles((theme: Theme) =>
   createStyles({

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

@@ -1,7 +1,7 @@
 import { Option } from '@/components/customSelector/Types';
 import { METRIC_TYPES_VALUES, DataTypeStringEnum } from '@/consts';
 import { IForm } from '@/hooks';
-import { IndexType } from '@/pages/schema/Types';
+import { IndexType } from '@/pages/databases/collections/overview/Types';
 
 interface IInfo {
   [key: string]: any;

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

@@ -4,7 +4,7 @@ import {
   DEFAULT_PROMETHEUS_PORT,
   DataTypeEnum,
 } from '@/consts';
-import { CreateFieldType, CreateField } from '@/pages/collections/Types';
+import { CreateFieldType, CreateField } from '@/pages/databases/collections/Types';
 import { FieldObject } from '@server/types';
 
 /**

+ 1 - 1
client/src/utils/code/Types.ts

@@ -1,4 +1,4 @@
-import { IndexExtraParam } from '../../pages/schema/Types';
+import { IndexExtraParam } from '../../pages/databases/collections/overview/Types';
 export interface CreateIndexCodeParam {
   collectionName: string;
   fieldName: string;