Browse Source

add missing key

Signed-off-by: shanghaikid <jiangruiyi@gmail.com>
shanghaikid 1 year ago
parent
commit
a34de1a853
2 changed files with 19 additions and 30 deletions
  1. 2 1
      client/src/pages/segments/Segments.tsx
  2. 17 29
      client/src/pages/segments/Types.ts

+ 2 - 1
client/src/pages/segments/Segments.tsx

@@ -7,12 +7,13 @@ import { ColDefinitionsType } from '@/components/grid/Types';
 import { ToolBarConfig } from '@/components/grid/Types';
 import CustomToolBar from '@/components/grid/ToolBar';
 import { getQueryStyles } from '../query/Styles';
+import { Segment } from './Types';
 
 const Segments: FC<{
   collectionName: string;
 }> = ({ collectionName }) => {
   const classes = getQueryStyles();
-  const [segments, setSegements] = useState<any[]>([]);
+  const [segments, setSegements] = useState<Segment[]>([]);
   const { t: collectionTrans } = useTranslation('collection');
   const [loading, setLoading] = useState<boolean>(true);
 

+ 17 - 29
client/src/pages/segments/Types.ts

@@ -1,29 +1,17 @@
-import { ReactElement } from 'react';
-import { LOADING_STATE } from '@/consts';
-import { ManageRequestMethods } from '../../types/Common';
-
-export interface PartitionData {
-  _id: string;
-  _name: string;
-  _status: LOADING_STATE;
-  _rowCount: string;
-  _formatName: string;
-}
-
-export interface PartitionView extends PartitionData {
-  _nameElement?: ReactElement;
-  _statusElement?: ReactElement;
-}
-
-// delete and create
-export interface PartitionManageParam {
-  collectionName: string;
-  partitionName: string;
-  type: ManageRequestMethods;
-}
-
-// load and release
-export interface PartitionParam {
-  collectionName: string;
-  partitionNames: string[];
-}
+export type Segment = {
+  collectionID: string;
+  num_rows: string;
+  partitionID: string;
+  q_collectionID: string;
+  q_indexID: string;
+  q_index_name: string;
+  q_mem_size: string;
+  q_nodeID: string;
+  q_nodeIds: string[];
+  q_num_rows: string;
+  q_partitionID: string;
+  q_segmentID: string;
+  q_state: string;
+  segmentID: string;
+  state: string;
+};