Browse Source

Merge pull request #113 from Tumao727/fix-schema-desc

fix schema table missing description
ryjiang 4 years ago
parent
commit
ad8f840d16

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

@@ -65,7 +65,7 @@ export class CollectionHttp extends BaseModel implements CollectionView {
   }
 
   get _desc() {
-    return this.description;
+    return this.description || '--';
   }
 
   get _id() {

+ 5 - 0
client/src/http/Field.ts

@@ -8,6 +8,7 @@ export class FieldHttp extends BaseModel implements FieldData {
   type_params!: { key: string; value: string }[];
   is_primary_key!: true;
   name!: string;
+  description!: string;
 
   constructor(props: {}) {
     super(props);
@@ -41,6 +42,10 @@ export class FieldHttp extends BaseModel implements FieldData {
     return this.data_type;
   }
 
+  get _desc() {
+    return this.description || '--';
+  }
+
   get _dimension() {
     return this.type_params.find(item => item.key === 'dim')?.value || '--';
   }

+ 1 - 0
client/src/i18n/cn/index.ts

@@ -5,6 +5,7 @@ const indexTrans = {
 
   index: 'Index',
   metric: 'Metric Type',
+  desc: 'Description',
 
   createSuccess: 'Creating index successfully',
   deleteWarning:

+ 1 - 0
client/src/i18n/en/index.ts

@@ -4,6 +4,7 @@ const indexTrans = {
 
   create: 'Create Index',
   index: 'Index',
+  desc: 'Description',
 
   metric: 'Metric Type',
   createSuccess: 'Creating index successfully',

+ 6 - 0
client/src/pages/schema/Schema.tsx

@@ -187,6 +187,12 @@ const Schema: FC<{
       disablePadding: false,
       label: indexTrans('param'),
     },
+    {
+      id: '_desc',
+      align: 'left',
+      disablePadding: false,
+      label: indexTrans('desc'),
+    },
   ];
 
   const handlePageChange = (e: any, page: number) => {

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

@@ -20,6 +20,7 @@ export interface FieldData {
   _fieldNameElement?: ReactElement;
   _fieldType: DataType;
   _dimension: string;
+  _desc: string;
 }
 
 export interface FieldView extends FieldData, IndexView {