Browse Source

Merge pull request #106 from Tumao727/fix/structure

update schema and entity text
nameczz 4 years ago
parent
commit
1bebe72f79

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

@@ -1,5 +1,5 @@
 import { DataType } from '../pages/collections/Types';
-import { FieldData } from '../pages/structure/Types';
+import { FieldData } from '../pages/schema/Types';
 import BaseModel from './BaseModel';
 
 export class FieldHttp extends BaseModel implements FieldData {

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

@@ -3,7 +3,7 @@ import {
   IndexManageParam,
   IndexView,
   ParamPair,
-} from '../pages/structure/Types';
+} from '../pages/schema/Types';
 import { ManageRequestMethods } from '../types/Common';
 import { IndexState } from '../types/Milvus';
 import BaseModel from './BaseModel';

+ 4 - 4
client/src/i18n/cn/collection.ts

@@ -2,8 +2,8 @@ const collectionTrans = {
   noLoadData: 'No Loaded Collection',
   noData: 'No Collection',
 
-  rowCount: 'Row Count',
-  tooltip: 'data in one row',
+  rowCount: 'Entity Count',
+  tooltip: 'data in one entity',
 
   create: 'Create Collection',
   delete: 'delete',
@@ -19,7 +19,7 @@ const collectionTrans = {
   // create dialog
   createTitle: 'Create Collection',
   general: '1. General Info',
-  structure: '2. Define Structure',
+  schema: '2. Define Schema',
   description: 'Description (Optional)',
   fieldType: 'Field Type',
   vectorFieldType: 'Vector Field Type',
@@ -53,7 +53,7 @@ const collectionTrans = {
 
   // collection tabs
   partitionTab: 'Partitions',
-  structureTab: 'Structure',
+  schemaTab: 'Schema',
 };
 
 export default collectionTrans;

+ 1 - 1
client/src/i18n/cn/overview.ts

@@ -2,7 +2,7 @@ const overviewTrans = {
   load: 'Loaded Collections',
   all: 'All Collections',
   data: 'Data',
-  rows: '{{number}} Rows',
+  rows: '{{number}} Entities',
 };
 
 export default overviewTrans;

+ 2 - 2
client/src/i18n/cn/partition.ts

@@ -7,8 +7,8 @@ const partitionTrans = {
   id: 'ID',
   name: 'Name',
   status: 'Status',
-  rowCount: 'Row Count',
-  tooltip: 'data in one row',
+  rowCount: 'Entity Count',
+  tooltip: 'data in one entity',
 
   createTitle: 'Create Partition',
   nameWarning: '_default is reserved, cannot be used as name',

+ 4 - 4
client/src/i18n/en/collection.ts

@@ -2,8 +2,8 @@ const collectionTrans = {
   noLoadData: 'No Loaded Collection',
   noData: 'No Collection',
 
-  rowCount: 'Row Count',
-  tooltip: 'data in one row',
+  rowCount: 'Entity Count',
+  tooltip: 'data in one entity',
 
   create: 'Create Collection',
   delete: 'delete',
@@ -19,7 +19,7 @@ const collectionTrans = {
   // create dialog
   createTitle: 'Create Collection',
   general: '1. General Info',
-  structure: '2. Define Structure',
+  schema: '2. Define Schema',
   description: 'Description (Optional)',
   fieldType: 'Field Type',
   vectorFieldType: 'Vector Field Type',
@@ -53,7 +53,7 @@ const collectionTrans = {
 
   // collection tabs
   partitionTab: 'Partitions',
-  structureTab: 'Structure',
+  schemaTab: 'Schema',
 };
 
 export default collectionTrans;

+ 1 - 1
client/src/i18n/en/overview.ts

@@ -2,7 +2,7 @@ const overviewTrans = {
   load: 'Loaded Collections',
   all: 'All Collections',
   data: 'Data',
-  rows: '{{number}} Rows',
+  rows: '{{number}} Entities',
 };
 
 export default overviewTrans;

+ 2 - 2
client/src/i18n/en/partition.ts

@@ -7,8 +7,8 @@ const partitionTrans = {
   id: 'ID',
   name: 'Name',
   status: 'Status',
-  rowCount: 'Row Count',
-  tooltip: 'data in one row',
+  rowCount: 'Entity Count',
+  tooltip: 'data in one entity',
 
   createTitle: 'Create Partition',
   nameWarning: '_default is reserved, cannot be used as name',

+ 6 - 6
client/src/pages/collections/Collection.tsx

@@ -3,14 +3,14 @@ import { useNavigationHook } from '../../hooks/Navigation';
 import { ALL_ROUTER_TYPES } from '../../router/Types';
 import CustomTabList from '../../components/customTabList/CustomTabList';
 import { ITab } from '../../components/customTabList/Types';
-import Partitions from '../partitions/partitions';
+import Partitions from '../partitions/Partitions';
 import { useHistory, useLocation, useParams } from 'react-router-dom';
 import { useMemo } from 'react';
 import { parseLocationSearch } from '../../utils/Format';
-import Structure from '../structure/Structure';
+import Schema from '../schema/Schema';
 
 enum TAB_EMUM {
-  'structure',
+  'schema',
   'partition',
 }
 
@@ -29,7 +29,7 @@ const Collection = () => {
   const activeTabIndex = useMemo(() => {
     const { activeIndex } = location.search
       ? parseLocationSearch(location.search)
-      : { activeIndex: TAB_EMUM.structure };
+      : { activeIndex: TAB_EMUM.schema };
     return Number(activeIndex);
   }, [location]);
 
@@ -40,8 +40,8 @@ const Collection = () => {
 
   const tabs: ITab[] = [
     {
-      label: collectionTrans('structureTab'),
-      component: <Structure collectionName={collectionName} />,
+      label: collectionTrans('schemaTab'),
+      component: <Schema collectionName={collectionName} />,
     },
     {
       label: collectionTrans('partitionTab'),

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

@@ -195,7 +195,7 @@ const CreateCollection: FC<CollectionCreateProps> = ({ handleCreate }) => {
         </fieldset>
 
         <fieldset className={classes.fieldset}>
-          <legend>{collectionTrans('structure')}</legend>
+          <legend>{collectionTrans('schema')}</legend>
           <CreateFields
             fields={fields}
             setFields={setFields}

+ 0 - 0
client/src/pages/partitions/partitions.tsx → client/src/pages/partitions/Partitions.tsx


+ 0 - 0
client/src/pages/structure/Create.tsx → client/src/pages/schema/Create.tsx


+ 0 - 0
client/src/pages/structure/CreateForm.tsx → client/src/pages/schema/CreateForm.tsx


+ 0 - 0
client/src/pages/structure/IndexTypeElement.tsx → client/src/pages/schema/IndexTypeElement.tsx


+ 11 - 11
client/src/pages/structure/Structure.tsx → client/src/pages/schema/Schema.tsx

@@ -48,7 +48,7 @@ const useStyles = makeStyles((theme: Theme) => ({
   },
 }));
 
-const Structure: FC<{
+const Schema: FC<{
   collectionName: string;
 }> = ({ collectionName }) => {
   const classes = useStyles();
@@ -65,23 +65,23 @@ const Structure: FC<{
     currentPage,
     handleCurrentPage,
     total,
-    data: structureList,
+    data: schemaList,
   } = usePaginationHook(fields);
 
-  const fetchStructureListWithIndex = async (
+  const fetchSchemaListWithIndex = async (
     collectionName: string
   ): Promise<FieldView[]> => {
     const vectorTypes: DataType[] = ['BinaryVector', 'FloatVector'];
     const indexList = await IndexHttp.getIndexInfo(collectionName);
-    const structureList = await FieldHttp.getFields(collectionName);
+    const schemaList = await FieldHttp.getFields(collectionName);
     let fields: FieldView[] = [];
-    for (const structure of structureList) {
-      let field: FieldView = Object.assign(structure, {
+    for (const schema of schemaList) {
+      let field: FieldView = Object.assign(schema, {
         _indexParameterPairs: [],
         _indexType: '',
       });
-      if (vectorTypes.includes(structure.data_type)) {
-        const index = indexList.find(i => i._fieldName === structure.name);
+      if (vectorTypes.includes(schema.data_type)) {
+        const index = indexList.find(i => i._fieldName === schema.name);
 
         field._indexParameterPairs = index?._indexParameterPairs || [];
         field._indexType = index?._indexType || '';
@@ -98,7 +98,7 @@ const Structure: FC<{
       const KeyIcon = icons.key;
 
       try {
-        const list = await fetchStructureListWithIndex(collectionName);
+        const list = await fetchSchemaListWithIndex(collectionName);
         const fields: FieldView[] = list.map(f =>
           Object.assign(f, {
             _fieldNameElement: (
@@ -198,7 +198,7 @@ const Structure: FC<{
       <MilvusGrid
         toolbarConfigs={[]}
         colDefinitions={colDefinitions}
-        rows={structureList}
+        rows={schemaList}
         rowCount={total}
         primaryKey="_fieldId"
         openCheckBox={false}
@@ -213,4 +213,4 @@ const Structure: FC<{
   );
 };
 
-export default Structure;
+export default Schema;

+ 0 - 0
client/src/pages/structure/Types.ts → client/src/pages/schema/Types.ts


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

@@ -2,7 +2,7 @@ import { Option } from '../components/customSelector/Types';
 import { METRIC_TYPES_VALUES } from '../consts/Milvus';
 import { IForm } from '../hooks/Form';
 import { DataType } from '../pages/collections/Types';
-import { IndexType } from '../pages/structure/Types';
+import { IndexType } from '../pages/schema/Types';
 
 interface IInfo {
   [key: string]: any;