mirror of
https://github.com/haiwen/seahub.git
synced 2025-04-27 19:05:16 +00:00
update
This commit is contained in:
parent
8d837c8195
commit
17a4f2c637
@ -93,14 +93,14 @@ export const MetadataAIOperationsProvider = ({
|
||||
}, [extractFilesDetails]);
|
||||
|
||||
const faceRecognition = useCallback((objIds, { success_callback, fail_callback } = {}) => {
|
||||
const inProgressToaster = toaster.notifyInProgress(gettext('Recognize faces by AI...'), { duration: null });
|
||||
const inProgressToaster = toaster.notifyInProgress(gettext('Detecting faces by AI...'), { duration: null });
|
||||
metadataAPI.recognizeFaces(repoID, objIds).then(res => {
|
||||
inProgressToaster.close();
|
||||
toaster.success(gettext('Faces recognized'));
|
||||
toaster.success(gettext('Faces detected'));
|
||||
success_callback && success_callback();
|
||||
}).catch(error => {
|
||||
inProgressToaster.close();
|
||||
const errorMessage = gettext('Failed to recognize faces');
|
||||
const errorMessage = gettext('Failed to detect faces');
|
||||
toaster.danger(errorMessage);
|
||||
fail_callback && fail_callback();
|
||||
});
|
||||
|
@ -30,7 +30,7 @@ const OPERATION = {
|
||||
RENAME_FILE: 'rename-file',
|
||||
FILE_DETAIL: 'file-detail',
|
||||
FILE_DETAILS: 'file-details',
|
||||
FACE_RECOGNITION: 'face-recognition',
|
||||
DETECT_FACES: 'detect-faces',
|
||||
MOVE: 'move',
|
||||
};
|
||||
|
||||
@ -125,7 +125,7 @@ const ContextMenu = ({
|
||||
return Utils.imageCheck(fileName);
|
||||
});
|
||||
if (imageRecords.length > 0) {
|
||||
list.push({ value: OPERATION.FACE_RECOGNITION, label: gettext('Face recognition'), records: imageRecords });
|
||||
list.push({ value: OPERATION.DETECT_FACES, label: gettext('Detect faces'), records: imageRecords });
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@ -165,7 +165,7 @@ const ContextMenu = ({
|
||||
return Utils.imageCheck(fileName);
|
||||
});
|
||||
if (imageRecords.length > 0) {
|
||||
list.push({ value: OPERATION.FACE_RECOGNITION, label: gettext('Face recognition'), records: imageRecords });
|
||||
list.push({ value: OPERATION.DETECT_FACES, label: gettext('Detect faces'), records: imageRecords });
|
||||
}
|
||||
return list;
|
||||
}
|
||||
@ -213,7 +213,7 @@ const ContextMenu = ({
|
||||
aiOptions.push({ value: OPERATION.FILE_DETAIL, label: gettext('Extract file detail'), record: record });
|
||||
}
|
||||
if (isImage) {
|
||||
aiOptions.push({ value: OPERATION.FACE_RECOGNITION, label: gettext('Face recognition'), records: [record] });
|
||||
aiOptions.push({ value: OPERATION.DETECT_FACES, label: gettext('Detect faces'), records: [record] });
|
||||
}
|
||||
|
||||
if (descriptionColumn && isDescribableFile) {
|
||||
@ -327,7 +327,7 @@ const ContextMenu = ({
|
||||
updateRecordDetails([record]);
|
||||
break;
|
||||
}
|
||||
case OPERATION.FACE_RECOGNITION: {
|
||||
case OPERATION.DETECT_FACES: {
|
||||
const { records } = option;
|
||||
updateFaceRecognition(records);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user