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>) => {
|
||||
if (!datasource)
|
||||
return
|
||||
const datasourceInfo: Record<string, any> = {}
|
||||
const datasourceInfoList: Record<string, any>[] = []
|
||||
let datasource_type = ''
|
||||
if (datasource.type === DataSourceType.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) {
|
||||
datasource_type = 'online_document'
|
||||
datasourceInfo.workspaceId = notionPages[0].workspace_id
|
||||
datasourceInfo.page = notionPages.map((page) => {
|
||||
const { workspace_id, ...rest } = page
|
||||
return rest
|
||||
})
|
||||
const { workspace_id, ...rest } = notionPages[0]
|
||||
const documentInfo = {
|
||||
workspace_id,
|
||||
page: rest,
|
||||
}
|
||||
datasourceInfoList.push(documentInfo)
|
||||
}
|
||||
if (datasource.type === DataSourceProvider.fireCrawl
|
||||
|| datasource.type === DataSourceProvider.jinaReader
|
||||
|| datasource.type === DataSourceProvider.waterCrawl) {
|
||||
datasource_type = 'website_crawl'
|
||||
datasourceInfo.jobId = websiteCrawlJobId
|
||||
datasourceInfo.result = websitePages
|
||||
const documentInfo = {
|
||||
job_id: websiteCrawlJobId,
|
||||
result: websitePages[0],
|
||||
}
|
||||
datasourceInfoList.push(documentInfo)
|
||||
}
|
||||
handleRun({
|
||||
inputs: data,
|
||||
start_node_id: datasource.nodeId,
|
||||
datasource_type,
|
||||
datasource_info: datasourceInfo,
|
||||
datasource_info_list: datasourceInfoList,
|
||||
})
|
||||
}, [datasource, fileList, handleRun, notionPages, websiteCrawlJobId, websitePages])
|
||||
|
||||
|
||||
@ -146,7 +146,7 @@ const BaseNode: FC<BaseNodeProps> = ({
|
||||
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='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>
|
||||
)
|
||||
|
||||
@ -45,7 +45,7 @@ export enum BlockEnum {
|
||||
Loop = 'loop',
|
||||
LoopStart = 'loop-start',
|
||||
LoopEnd = 'loop-end',
|
||||
DataSource = 'data-source',
|
||||
DataSource = 'datasource',
|
||||
KnowledgeBase = 'knowledge-index',
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ export type CommonNodeType<T = {}> = {
|
||||
retry_config?: WorkflowRetryConfig
|
||||
default_value?: DefaultValueForm[]
|
||||
} & 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 = {
|
||||
_hovering?: boolean
|
||||
|
||||
@ -256,7 +256,7 @@ const translation = {
|
||||
'loop': 'Loop',
|
||||
'loop-end': 'Exit Loop',
|
||||
'knowledge-index': 'Knowledge Base',
|
||||
'data-source': 'Data Source',
|
||||
'datasource': 'Data Source',
|
||||
},
|
||||
blocksAbout: {
|
||||
'start': 'Define the initial parameters for launching a workflow',
|
||||
@ -280,7 +280,7 @@ const translation = {
|
||||
'list-operator': 'Used to filter or sort array content.',
|
||||
'agent': 'Invoking large language models to answer questions or process natural language',
|
||||
'knowledge-index': 'Knowledge Base About',
|
||||
'data-source': 'Data Source About',
|
||||
'datasource': 'Data Source About',
|
||||
},
|
||||
operator: {
|
||||
zoomIn: 'Zoom In',
|
||||
|
||||
@ -257,7 +257,7 @@ const translation = {
|
||||
'loop': '循环',
|
||||
'loop-end': '退出循环',
|
||||
'knowledge-index': '知识库',
|
||||
'data-source': '数据源',
|
||||
'datasource': '数据源',
|
||||
},
|
||||
blocksAbout: {
|
||||
'start': '定义一个 workflow 流程启动的初始参数',
|
||||
@ -281,7 +281,7 @@ const translation = {
|
||||
'list-operator': '用于过滤或排序数组内容。',
|
||||
'agent': '调用大型语言模型回答问题或处理自然语言',
|
||||
'knowledge-index': '知识库节点',
|
||||
'data-source': '数据源节点',
|
||||
'datasource': '数据源节点',
|
||||
},
|
||||
operator: {
|
||||
zoomIn: '放大',
|
||||
|
||||
@ -164,7 +164,7 @@ export const usePublishedPipelineProcessingParams = (params: PipelineProcessingP
|
||||
export const useDataSourceList = (enabled: boolean, onSuccess: (v: ToolWithProvider[]) => void) => {
|
||||
return useQuery<ToolWithProvider[]>({
|
||||
enabled,
|
||||
queryKey: [NAME_SPACE, 'data-source'],
|
||||
queryKey: [NAME_SPACE, 'datasource'],
|
||||
queryFn: async () => {
|
||||
const data = await get<ToolWithProvider[]>('/rag/pipelines/datasource-plugins')
|
||||
onSuccess(data)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user