mirror of
https://github.com/langgenius/dify.git
synced 2025-10-27 17:09:01 +00:00
refactor: standardize terminology by renaming 'data-source' to 'datasource' across components and translations
This commit is contained in:
parent
841bd35ebb
commit
13e3f17493
@ -96,32 +96,44 @@ const TestRunPanel = () => {
|
|||||||
const handleProcess = useCallback((data: Record<string, any>) => {
|
const handleProcess = useCallback((data: Record<string, any>) => {
|
||||||
if (!datasource)
|
if (!datasource)
|
||||||
return
|
return
|
||||||
const datasourceInfo: Record<string, any> = {}
|
const datasourceInfoList: Record<string, any>[] = []
|
||||||
let datasource_type = ''
|
let datasource_type = ''
|
||||||
if (datasource.type === DataSourceType.FILE) {
|
if (datasource.type === DataSourceType.FILE) {
|
||||||
datasource_type = 'local_file'
|
datasource_type = 'local_file'
|
||||||
datasourceInfo.fileId = fileList.map(file => file.fileID)
|
const documentInfo = {
|
||||||
|
upload_file_id: fileList[0].file.id,
|
||||||
|
name: fileList[0].file.name,
|
||||||
|
type: fileList[0].file.type,
|
||||||
|
size: fileList[0].file.size,
|
||||||
|
extension: fileList[0].file.extension,
|
||||||
|
mime_type: fileList[0].file.mime_type,
|
||||||
|
}
|
||||||
|
datasourceInfoList.push(documentInfo)
|
||||||
}
|
}
|
||||||
if (datasource.type === DataSourceType.NOTION) {
|
if (datasource.type === DataSourceType.NOTION) {
|
||||||
datasource_type = 'online_document'
|
datasource_type = 'online_document'
|
||||||
datasourceInfo.workspaceId = notionPages[0].workspace_id
|
const { workspace_id, ...rest } = notionPages[0]
|
||||||
datasourceInfo.page = notionPages.map((page) => {
|
const documentInfo = {
|
||||||
const { workspace_id, ...rest } = page
|
workspace_id,
|
||||||
return rest
|
page: rest,
|
||||||
})
|
}
|
||||||
|
datasourceInfoList.push(documentInfo)
|
||||||
}
|
}
|
||||||
if (datasource.type === DataSourceProvider.fireCrawl
|
if (datasource.type === DataSourceProvider.fireCrawl
|
||||||
|| datasource.type === DataSourceProvider.jinaReader
|
|| datasource.type === DataSourceProvider.jinaReader
|
||||||
|| datasource.type === DataSourceProvider.waterCrawl) {
|
|| datasource.type === DataSourceProvider.waterCrawl) {
|
||||||
datasource_type = 'website_crawl'
|
datasource_type = 'website_crawl'
|
||||||
datasourceInfo.jobId = websiteCrawlJobId
|
const documentInfo = {
|
||||||
datasourceInfo.result = websitePages
|
job_id: websiteCrawlJobId,
|
||||||
|
result: websitePages[0],
|
||||||
|
}
|
||||||
|
datasourceInfoList.push(documentInfo)
|
||||||
}
|
}
|
||||||
handleRun({
|
handleRun({
|
||||||
inputs: data,
|
inputs: data,
|
||||||
start_node_id: datasource.nodeId,
|
start_node_id: datasource.nodeId,
|
||||||
datasource_type,
|
datasource_type,
|
||||||
datasource_info: datasourceInfo,
|
datasource_info_list: datasourceInfoList,
|
||||||
})
|
})
|
||||||
}, [datasource, fileList, handleRun, notionPages, websiteCrawlJobId, websitePages])
|
}, [datasource, fileList, handleRun, notionPages, websiteCrawlJobId, websitePages])
|
||||||
|
|
||||||
|
|||||||
@ -146,7 +146,7 @@ const BaseNode: FC<BaseNodeProps> = ({
|
|||||||
data.type === BlockEnum.DataSource && (
|
data.type === BlockEnum.DataSource && (
|
||||||
<div className='absolute inset-[-2px] top-[-22px] z-[-1] rounded-[18px] bg-node-data-source-bg p-0.5 backdrop-blur-[6px]'>
|
<div className='absolute inset-[-2px] top-[-22px] z-[-1] rounded-[18px] bg-node-data-source-bg p-0.5 backdrop-blur-[6px]'>
|
||||||
<div className='system-2xs-semibold-uppercase flex h-5 items-center px-2.5 text-text-tertiary'>
|
<div className='system-2xs-semibold-uppercase flex h-5 items-center px-2.5 text-text-tertiary'>
|
||||||
{t('workflow.blocks.data-source')}
|
{t('workflow.blocks.datasource')}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -45,7 +45,7 @@ export enum BlockEnum {
|
|||||||
Loop = 'loop',
|
Loop = 'loop',
|
||||||
LoopStart = 'loop-start',
|
LoopStart = 'loop-start',
|
||||||
LoopEnd = 'loop-end',
|
LoopEnd = 'loop-end',
|
||||||
DataSource = 'data-source',
|
DataSource = 'datasource',
|
||||||
KnowledgeBase = 'knowledge-index',
|
KnowledgeBase = 'knowledge-index',
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ export type CommonNodeType<T = {}> = {
|
|||||||
retry_config?: WorkflowRetryConfig
|
retry_config?: WorkflowRetryConfig
|
||||||
default_value?: DefaultValueForm[]
|
default_value?: DefaultValueForm[]
|
||||||
} & T & Partial<Pick<ToolDefaultValue, 'provider_id' | 'provider_type' | 'provider_name' | 'tool_name'>>
|
} & T & Partial<Pick<ToolDefaultValue, 'provider_id' | 'provider_type' | 'provider_name' | 'tool_name'>>
|
||||||
& Partial<Pick<DataSourceDefaultValue, 'provider_id' | 'provider_type' | 'provider_name' | 'datasource_name'>>
|
& Partial<Pick<DataSourceDefaultValue, 'provider_id' | 'provider_type' | 'provider_name' | 'datasource_name'>>
|
||||||
|
|
||||||
export type CommonEdgeType = {
|
export type CommonEdgeType = {
|
||||||
_hovering?: boolean
|
_hovering?: boolean
|
||||||
|
|||||||
@ -256,7 +256,7 @@ const translation = {
|
|||||||
'loop': 'Loop',
|
'loop': 'Loop',
|
||||||
'loop-end': 'Exit Loop',
|
'loop-end': 'Exit Loop',
|
||||||
'knowledge-index': 'Knowledge Base',
|
'knowledge-index': 'Knowledge Base',
|
||||||
'data-source': 'Data Source',
|
'datasource': 'Data Source',
|
||||||
},
|
},
|
||||||
blocksAbout: {
|
blocksAbout: {
|
||||||
'start': 'Define the initial parameters for launching a workflow',
|
'start': 'Define the initial parameters for launching a workflow',
|
||||||
@ -280,7 +280,7 @@ const translation = {
|
|||||||
'list-operator': 'Used to filter or sort array content.',
|
'list-operator': 'Used to filter or sort array content.',
|
||||||
'agent': 'Invoking large language models to answer questions or process natural language',
|
'agent': 'Invoking large language models to answer questions or process natural language',
|
||||||
'knowledge-index': 'Knowledge Base About',
|
'knowledge-index': 'Knowledge Base About',
|
||||||
'data-source': 'Data Source About',
|
'datasource': 'Data Source About',
|
||||||
},
|
},
|
||||||
operator: {
|
operator: {
|
||||||
zoomIn: 'Zoom In',
|
zoomIn: 'Zoom In',
|
||||||
|
|||||||
@ -257,7 +257,7 @@ const translation = {
|
|||||||
'loop': '循环',
|
'loop': '循环',
|
||||||
'loop-end': '退出循环',
|
'loop-end': '退出循环',
|
||||||
'knowledge-index': '知识库',
|
'knowledge-index': '知识库',
|
||||||
'data-source': '数据源',
|
'datasource': '数据源',
|
||||||
},
|
},
|
||||||
blocksAbout: {
|
blocksAbout: {
|
||||||
'start': '定义一个 workflow 流程启动的初始参数',
|
'start': '定义一个 workflow 流程启动的初始参数',
|
||||||
@ -281,7 +281,7 @@ const translation = {
|
|||||||
'list-operator': '用于过滤或排序数组内容。',
|
'list-operator': '用于过滤或排序数组内容。',
|
||||||
'agent': '调用大型语言模型回答问题或处理自然语言',
|
'agent': '调用大型语言模型回答问题或处理自然语言',
|
||||||
'knowledge-index': '知识库节点',
|
'knowledge-index': '知识库节点',
|
||||||
'data-source': '数据源节点',
|
'datasource': '数据源节点',
|
||||||
},
|
},
|
||||||
operator: {
|
operator: {
|
||||||
zoomIn: '放大',
|
zoomIn: '放大',
|
||||||
|
|||||||
@ -164,7 +164,7 @@ export const usePublishedPipelineProcessingParams = (params: PipelineProcessingP
|
|||||||
export const useDataSourceList = (enabled: boolean, onSuccess: (v: ToolWithProvider[]) => void) => {
|
export const useDataSourceList = (enabled: boolean, onSuccess: (v: ToolWithProvider[]) => void) => {
|
||||||
return useQuery<ToolWithProvider[]>({
|
return useQuery<ToolWithProvider[]>({
|
||||||
enabled,
|
enabled,
|
||||||
queryKey: [NAME_SPACE, 'data-source'],
|
queryKey: [NAME_SPACE, 'datasource'],
|
||||||
queryFn: async () => {
|
queryFn: async () => {
|
||||||
const data = await get<ToolWithProvider[]>('/rag/pipelines/datasource-plugins')
|
const data = await get<ToolWithProvider[]>('/rag/pipelines/datasource-plugins')
|
||||||
onSuccess(data)
|
onSuccess(data)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user