diff --git a/web/app/components/datasets/common/credential-icon.tsx b/web/app/components/datasets/common/credential-icon.tsx index fc4143681d..d701ed25fa 100644 --- a/web/app/components/datasets/common/credential-icon.tsx +++ b/web/app/components/datasets/common/credential-icon.tsx @@ -26,13 +26,17 @@ export const CredentialIcon: React.FC = ({ if (avatar_url && avatar_url !== 'default') { return ( - {`${name} +
+ +
) } diff --git a/web/app/components/datasets/documents/create-from-pipeline/index.tsx b/web/app/components/datasets/documents/create-from-pipeline/index.tsx index 970c6fa694..4a25c357eb 100644 --- a/web/app/components/datasets/documents/create-from-pipeline/index.tsx +++ b/web/app/components/datasets/documents/create-from-pipeline/index.tsx @@ -209,10 +209,11 @@ const CreateFormPipeline = () => { } if (datasourceType === DatasourceType.onlineDrive) { const { bucket } = dataSourceStore.getState() - const { id } = previewOnlineDriveFileRef.current! + const { id, type } = previewOnlineDriveFileRef.current! datasourceInfoList.push({ bucket, id, + type, credential_id: currentCredentialId, }) } @@ -233,7 +234,7 @@ const CreateFormPipeline = () => { const handleProcess = useCallback(async (data: Record) => { if (!datasource) return - const { bucket, currentCredentialId } = dataSourceStore.getState() + const { bucket, currentCredentialId, fileList: onlineDriveFileList } = dataSourceStore.getState() const datasourceInfoList: Record[] = [] if (datasourceType === DatasourceType.localFile) { fileList.forEach((file) => { @@ -273,10 +274,12 @@ const CreateFormPipeline = () => { } if (datasourceType === DatasourceType.onlineDrive) { if (datasourceType === DatasourceType.onlineDrive) { - selectedFileIds.forEach((key) => { + selectedFileIds.forEach((id) => { + const file = onlineDriveFileList.find(file => file.id === id) datasourceInfoList.push({ bucket, - key, + id: file?.id, + type: file?.type, credential_id: currentCredentialId, }) }) diff --git a/web/app/components/rag-pipeline/components/panel/test-run/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/index.tsx index 048f13d79b..9b5dc0efee 100644 --- a/web/app/components/rag-pipeline/components/panel/test-run/index.tsx +++ b/web/app/components/rag-pipeline/components/panel/test-run/index.tsx @@ -107,10 +107,12 @@ const TestRunPanel = () => { }) } if (datasourceType === DatasourceType.onlineDrive) { - const { bucket } = dataSourceStore.getState() + const { bucket, fileList } = dataSourceStore.getState() + const file = fileList.find(file => file.id === selectedFileIds[0]) datasourceInfoList.push({ bucket, - id: selectedFileIds[0], + id: file?.id, + type: file?.type, credential_id: credentialId, }) }