Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support alias fix #92 #134

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions client/src/components/customToolTip/CustomToolTip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { makeStyles, Theme, createStyles } from '@material-ui/core';

const useStyles = makeStyles((theme: Theme) =>
createStyles({
tooltip: {
textTransform: 'capitalize',
},
tooltip: {},
})
);

Expand Down
13 changes: 12 additions & 1 deletion client/src/http/Collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
CollectionView,
DeleteEntitiesReq,
InsertDataParam,
LoadSampleParam
LoadSampleParam,
} from '../pages/collections/Types';
import { Field } from '../pages/schema/Types';
import { VectorSearchParam } from '../types/SearchTypes';
Expand All @@ -16,6 +16,7 @@ import dayjs from 'dayjs';
import { LOADING_STATE } from '../consts/Milvus';

export class CollectionHttp extends BaseModel implements CollectionView {
private aliases!: string[];
private autoID!: string;
private collection_name!: string;
private description!: string;
Expand Down Expand Up @@ -117,6 +118,12 @@ export class CollectionHttp extends BaseModel implements CollectionView {
});
}

static dropAlias(collectionName: string, params: { alias: string }) {
return super.delete({
path: `${this.COLLECTIONS_URL}/${collectionName}/alias/${params.alias}`,
});
}

static queryData(collectionName: string, params: QueryParam) {
return super.query({
path: `${this.COLLECTIONS_URL}/${collectionName}/query`,
Expand All @@ -128,6 +135,10 @@ export class CollectionHttp extends BaseModel implements CollectionView {
return this.autoID;
}

get _aliases() {
return this.aliases;
}

get _desc() {
return this.description || '--';
}
Expand Down
25 changes: 15 additions & 10 deletions client/src/i18n/cn/button.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
const btnTrans = {
cancel: '取消',
save: '保存',
reset: '重置',
update: '更新',
search: '搜索',
confirm: '确认',
connect: '连接',
import: '导入',
delete: '删除',
release: 'Release',
cancel: 'Cancel',
save: 'Save',
create: 'Create',
reset: 'Reset',
update: 'Update',
search: 'Search',
confirm: 'Confirm',
connect: 'Connect',
import: 'Import',
delete: 'Delete',
drop: 'Drop',
release: 'Release',
load: 'Load',
insert: 'Import Data',
refresh: 'Refresh',
next: 'Next',
previous: 'Previous',
done: 'Done',
vectorSearch: 'Vector search',
query: 'Query',
importSampleData: 'Import Sample data',
loading: 'Loading...',
importing: 'Importing...'
};

export default btnTrans;
36 changes: 25 additions & 11 deletions client/src/i18n/cn/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ const collectionTrans = {
noLoadData: 'No Loaded Collection',
noData: 'No Collection',

rowCount: 'Entity Count',
tooltip: 'Approximately entity count.',
rowCount: 'Approx Entity Count',

create: 'Create Collection',
delete: 'delete',
deleteTooltip: 'Please select at least one item to delete.',
alias: 'alias',
alias: 'Alias',
aliasTooltip: 'Please select one collection to create alias',
download: 'Download',
downloadTooltip: 'Download all query results',
Expand All @@ -19,29 +18,40 @@ const collectionTrans = {
// table
id: 'ID',
name: 'Name',
nameTip: 'Collection Name',
status: 'Status',
desc: 'Description',
createdTime: 'Created Time',
maxLength: 'Max Length',

// table tooltip
aliasInfo: 'Alias can be used as collection name in vector search.',
consistencyLevelInfo:
'Consistency refers to the property that ensures every node or replica has the same view of data when writing or reading data at a given time.',
entityCountInfo: 'Approximately entity count.',

// create dialog
createTitle: 'Create Collection',
general: '1. General Info',
schema: '2. Define Schema',
consistency: '3. Consistency Level',
general: 'General information',
schema: 'Schema',
consistency: 'Consistency Level',
consistencyLevel: 'Consistency Level',
description: 'Description (Optional)',
description: 'Description',
fieldType: 'Field Type',
vectorFieldType: 'Vector Field Type',
fieldName: 'Field Name',
idFieldName: 'ID Name',
vectorFieldName: 'Vector Name',
autoId: 'Auto ID',
vectorType: 'Vector Type',
idType: 'ID Type',
dimension: 'Dimension',
dimensionTooltip: 'Only vector type has dimension',
dimensionMutipleWarning: 'Dimension should be 8 multiple',
dimensionPositiveWarning: 'Dimension should be positive number',
dimensionPositiveWarning: 'Positive number only',
newBtn: 'add new field',
nameLengthWarning: 'Name length should be less than 256',
nameContentWarning: 'Only numbers, letters, and underscores are allowed',
nameContentWarning: 'Only numbers, letters, and underscores are allowed.',
nameFirstLetterWarning:
'Name first character must be underscore or character(a~z, A~Z)',

Expand All @@ -58,16 +68,20 @@ const collectionTrans = {
releaseConfirmLabel: 'Release',

// delete dialog
deleteWarning:
'You are trying to delete a collection with data. This action cannot be undone.',
deleteWarning: `You are trying to delete a collection with data. This action cannot be undone.`,
deleteDataWarning: `You are trying to delete entites. This action cannot be undone.`,
deleteAliasWarning: `You are trying to drop an alias. This action cannot be undone.`,

// collection tabs
partitionTab: 'Partitions',
schemaTab: 'Schema',
queryTab: 'Data Query',
previewTab: 'Data Preview',
startTip: 'Start your data query',
exprPlaceHolder: 'Please enter your query by using advanced filter ->',

// alias dialog
aliasCreatePlaceholder: 'Alias name',
};

export default collectionTrans;
3 changes: 1 addition & 2 deletions client/src/i18n/cn/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const commonTrans = {
ssl: 'SSL',
},
status: {
loaded: 'loaded for search',
loaded: 'loaded',
unloaded: 'unloaded',
error: 'error',
running: 'running',
Expand Down Expand Up @@ -42,7 +42,6 @@ const commonTrans = {
join: 'Join our growing social community today',
get: 'Get insight, tips and share ideas',
},

capacity: {
b: 'B',
kb: 'KB',
Expand Down
5 changes: 2 additions & 3 deletions client/src/i18n/cn/dialog.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const dialogTrans = {
deleteTipAction: 'Type',
deleteTipPurpose: 'to confirm.',
deleteTitle: `Delete {{type}}`,
createAlias: `Create alias for {{type}}`,

deleteTitle: `Drop {{type}}`,
releaseTitle: `Release {{type}}`,
createAlias: `Create alias for {{type}}`,
loadTitle: `Load {{type}}`,

loadContent: `You are trying to load a {{type}} with data. Only loaded {{type}} can be searched.`,
Expand Down
5 changes: 3 additions & 2 deletions client/src/i18n/cn/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
const indexTrans = {
type: 'Index Type',
param: 'Index Parameters',
create: 'Create Index',

create: 'Create Index',
index: 'Index',
metric: 'Metric Type',
desc: 'Description',

creating: 'Creating Index',

metric: 'Metric Type',
createSuccess: 'Start creating index',
deleteWarning:
'You are trying to delete an index. This action cannot be undone.',
Expand Down
5 changes: 5 additions & 0 deletions client/src/i18n/cn/insert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const insertTrans = {
'Uploaded data column count is not equal to schema count',
uploadAutoIdFieldWarning:
'AutoId field ({{fieldName}}) does not require data',

previewTipData: 'Data Preview(Top 4 rows shown)',
previewTipAction: '*Change header cell selector value to edit field name',
requiredFieldName: 'Field Name*',
Expand All @@ -27,6 +28,10 @@ const insertTrans = {
statusLoadingTip: 'Please wait patiently, thank you',
statusSuccess: 'Import Data Successfully!',
statusError: 'Import Data Failed!',

importSampleData: 'Import sample data into {{collection}}',
sampleDataSize: 'Choose sample data size',
importSampleDataDesc: `Import random data based on the collection's schema.`
};

export default insertTrans;
4 changes: 2 additions & 2 deletions client/src/i18n/cn/partition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const partitionTrans = {
name: 'Name',
createdTime: 'Created Time',
status: 'Status',
rowCount: 'Entity Count',
rowCount: 'Approx Entity Count',
tooltip: 'Approximately entity count.',

createTitle: 'Create Partition',
nameWarning: '_default is reserved, cannot be used as name',

deleteWarning:
'You are trying to delete partition. This action cannot be undone.',
deletePartitionError: 'default partition cannot be deleted',
deletePartitionError: 'default partition cannot be dropped',
};

export default partitionTrans;
3 changes: 1 addition & 2 deletions client/src/i18n/cn/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const searchTrans = {
result: 'Search Results',
topK: 'TopK {{number}}',
filter: 'Advanced Filter',
vectorValueWarning:
'Vector value should be an array of length {{dimension}}(dimension)',
vectorValueWarning: 'Vector value should be an array of length {{dimension}}',
timeTravel: 'Time Travel',
timeTravelPrefix: 'Data before',
};
Expand Down
3 changes: 2 additions & 1 deletion client/src/i18n/cn/success.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ const successTrans = {
connect: 'Connection to milvus successful',
create: `{{name}} has been created`,
load: `{{name}} has been loaded`,
delete: `Delete {{name}} successfully`,
delete: `{{name}} successfully dropped`,
release: `{{name}} has been released`,
update: `{{name}} has been updated`,
};

export default successTrans;
2 changes: 1 addition & 1 deletion client/src/i18n/cn/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const userTrans = {
newPassword: 'New Password',
confirmPassword: 'Confirm Password',
update: 'Update password',
isNotSame: 'Confirm password is not same as new password',
isNotSame: 'Not same as new password',
deleteTip:
'Please select at least one item to delete and root can not be deleted.',
};
Expand Down
3 changes: 2 additions & 1 deletion client/src/i18n/cn/warning.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const warningTrans = {
required: '{{name}} is required',
requiredOnly: 'Required',
positive: '{{name}} should be positive',
integer: '{{name}} should be integers',
range: 'range is {{min}} ~ {{max}}',
range: 'Range is {{min}} ~ {{max}}',
specValueOrRange:
'{{name}} should be {{specValue}}, or in range {{min}} ~ {{max}}',
noSupportIndexType:
Expand Down
1 change: 1 addition & 0 deletions client/src/i18n/en/button.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const btnTrans = {
connect: 'Connect',
import: 'Import',
delete: 'Delete',
drop: 'Drop',
release: 'Release',
load: 'Load',
insert: 'Import Data',
Expand Down
15 changes: 12 additions & 3 deletions client/src/i18n/en/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ const collectionTrans = {
noLoadData: 'No Loaded Collection',
noData: 'No Collection',

rowCount: 'Entity Count',
tooltip: 'Approximately entity count.',
rowCount: 'Approx Entity Count',

create: 'Create Collection',
delete: 'delete',
deleteTooltip: 'Please select at least one item to delete.',
alias: 'alias',
alias: 'Alias',
aliasTooltip: 'Please select one collection to create alias',
download: 'Download',
downloadTooltip: 'Download all query results',
Expand All @@ -25,6 +24,12 @@ const collectionTrans = {
createdTime: 'Created Time',
maxLength: 'Max Length',

// table tooltip
aliasInfo: 'Alias can be used as collection name in vector search.',
consistencyLevelInfo:
'Consistency refers to the property that ensures every node or replica has the same view of data when writing or reading data at a given time.',
entityCountInfo: 'Approximately entity count.',

// create dialog
createTitle: 'Create Collection',
general: 'General information',
Expand Down Expand Up @@ -65,6 +70,7 @@ const collectionTrans = {
// delete dialog
deleteWarning: `You are trying to delete a collection with data. This action cannot be undone.`,
deleteDataWarning: `You are trying to delete entites. This action cannot be undone.`,
deleteAliasWarning: `You are trying to drop an alias. This action cannot be undone.`,

// collection tabs
partitionTab: 'Partitions',
Expand All @@ -73,6 +79,9 @@ const collectionTrans = {
previewTab: 'Data Preview',
startTip: 'Start your data query',
exprPlaceHolder: 'Please enter your query by using advanced filter ->',

// alias dialog
aliasCreatePlaceholder: 'Alias name',
};

export default collectionTrans;
2 changes: 1 addition & 1 deletion client/src/i18n/en/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const commonTrans = {
ssl: 'SSL',
},
status: {
loaded: 'loaded for search',
loaded: 'loaded',
unloaded: 'unloaded',
error: 'error',
running: 'running',
Expand Down
2 changes: 1 addition & 1 deletion client/src/i18n/en/dialog.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const dialogTrans = {
deleteTipAction: 'Type',
deleteTipPurpose: 'to confirm.',
deleteTitle: `Delete {{type}}`,
deleteTitle: `Drop {{type}}`,
releaseTitle: `Release {{type}}`,
createAlias: `Create alias for {{type}}`,
loadTitle: `Load {{type}}`,
Expand Down
4 changes: 2 additions & 2 deletions client/src/i18n/en/partition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const partitionTrans = {
name: 'Name',
createdTime: 'Created Time',
status: 'Status',
rowCount: 'Entity Count',
rowCount: 'Approx Entity Count',
tooltip: 'Approximately entity count.',

createTitle: 'Create Partition',
nameWarning: '_default is reserved, cannot be used as name',

deleteWarning:
'You are trying to delete partition. This action cannot be undone.',
deletePartitionError: 'default partition cannot be deleted',
deletePartitionError: 'default partition cannot be dropped',
};

export default partitionTrans;
Loading