= ({
-
- {doc?.data_source_type === DataSourceType.NOTION && }
- {doc?.data_source_type === DataSourceType.FILE && }
- {doc?.data_source_type === DataSourceType.WEB && }
+
+ {isOnlineDocument(doc.data_source_type, doc.created_from) && (
+
+ )}
+ {isLocalFile(doc.data_source_type, doc.created_from) && (
+
+ )}
+ {isOnlineDrive(doc.data_source_type, doc.created_from) && (
+
+ )}
+ {isWebsiteCrawl(doc.data_source_type, doc.created_from) && (
+
+ )}
= ({
|
{
- (['indexing', 'splitting', 'parsing', 'cleaning'].includes(doc.indexing_status) && doc?.data_source_type === DataSourceType.NOTION)
+ (['indexing', 'splitting', 'parsing', 'cleaning'].includes(doc.indexing_status)
+ && isOnlineDocument(doc.data_source_type, doc.created_from))
?
:
}
diff --git a/web/app/components/rag-pipeline/components/panel/test-run/preparation/index.tsx b/web/app/components/rag-pipeline/components/panel/test-run/preparation/index.tsx
index 0f869c2621..81f6ed5271 100644
--- a/web/app/components/rag-pipeline/components/panel/test-run/preparation/index.tsx
+++ b/web/app/components/rag-pipeline/components/panel/test-run/preparation/index.tsx
@@ -109,6 +109,7 @@ const Preparation = () => {
datasourceInfoList.push({
bucket,
id: file?.id,
+ name: file?.name,
type: file?.type,
credential_id: credentialId,
})
diff --git a/web/models/datasets.ts b/web/models/datasets.ts
index 8132acb83f..9c17980865 100644
--- a/web/models/datasets.ts
+++ b/web/models/datasets.ts
@@ -1,5 +1,5 @@
import type { DataSourceNotionPage, DataSourceProvider } from './common'
-import type { AppIconType, AppMode, RetrievalConfig } from '@/types/app'
+import type { AppIconType, AppMode, RetrievalConfig, TransferMethod } from '@/types/app'
import type { Tag } from '@/app/components/base/tag-management/constant'
import type { IndexingType } from '@/app/components/datasets/create/step-two'
import type { MetadataFilteringVariableType } from '@/app/components/workflow/nodes/knowledge-retrieval/types'
@@ -308,7 +308,7 @@ export const DisplayStatusList = [
export type DocumentDisplayStatus = typeof DisplayStatusList[number]
-export type DataSourceInfo = {
+export type LegacyDataSourceInfo = {
upload_file: {
id: string
name: string
@@ -327,6 +327,47 @@ export type DataSourceInfo = {
credential_id?: string
}
+export type LocalFileInfo = {
+ extension: string
+ mime_type: string
+ name: string
+ related_id: string
+ size: number
+ transfer_method: TransferMethod
+ url: string
+}
+
+export type WebsiteCrawlInfo = {
+ content: string
+ credential_id: string
+ description: string
+ source_url: string
+ title: string
+}
+
+export type OnlineDocumentInfo = {
+ credential_id: string
+ workspace_id: string
+ page: {
+ last_edited_time: string
+ page_icon: DataSourceNotionPage['page_icon']
+ page_id: string
+ page_name: string
+ parent_id: string
+ type: string
+ },
+}
+
+export type OnlineDriveInfo = {
+ bucket: string
+ credential_id: string
+ id: string
+ name: string
+ type: 'file' | 'folder'
+}
+
+export type DataSourceInfo = LegacyDataSourceInfo | LocalFileInfo | OnlineDocumentInfo | WebsiteCrawlInfo
+
export type InitialDocumentDetail = {
id: string
batch: string
@@ -350,7 +391,6 @@ export type InitialDocumentDetail = {
export type SimpleDocumentDetail = InitialDocumentDetail & {
enabled: boolean
word_count: number
- is_qa: boolean // TODO waiting for backend to add this field
error?: string | null
archived: boolean
updated_at: number
@@ -363,6 +403,7 @@ export type SimpleDocumentDetail = InitialDocumentDetail & {
}
}
doc_metadata?: MetadataItemWithValue[]
+ created_from: string
}
export type DocumentListResponse = {
|