diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx
index 7279969cfb..8721a430f0 100644
--- a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx
+++ b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx
@@ -85,7 +85,7 @@ const Popup = () => {
>
- Go to add documents
+ {t('pipeline.common.goToAddDocuments')}
@@ -95,7 +95,7 @@ const Popup = () => {
>
- Access API Reference
+ {t('workflow.common.accessAPIReference')}
@@ -106,7 +106,7 @@ const Popup = () => {
>
- Publish as a Knowledge Pipeline
+ {t('pipeline.common.publishAs')}
diff --git a/web/app/components/rag-pipeline/hooks/use-pipeline-config.ts b/web/app/components/rag-pipeline/hooks/use-pipeline-config.ts
index f16cd03938..4b16ebcef4 100644
--- a/web/app/components/rag-pipeline/hooks/use-pipeline-config.ts
+++ b/web/app/components/rag-pipeline/hooks/use-pipeline-config.ts
@@ -4,7 +4,6 @@ import {
useWorkflowStore,
} from '@/app/components/workflow/store'
import { useWorkflowConfig } from '@/service/use-workflow'
-import type { ToolWithProvider } from '@/app/components/workflow/types'
import type { FetchWorkflowDraftResponse } from '@/types/workflow'
export const usePipelineConfig = () => {
@@ -21,16 +20,6 @@ export const usePipelineConfig = () => {
handleUpdateWorkflowConfig,
)
- const handleUpdateDataSourceList = useCallback((dataSourceList: ToolWithProvider[]) => {
- const { setDataSourceList } = workflowStore.getState()
-
- setDataSourceList!(dataSourceList)
- }, [workflowStore])
- useWorkflowConfig(
- '/rag/pipelines/datasource-plugins',
- handleUpdateDataSourceList,
- )
-
const handleUpdateNodesDefaultConfigs = useCallback((nodesDefaultConfigs: Record) => {
const { setNodesDefaultConfigs } = workflowStore.getState()
diff --git a/web/app/components/rag-pipeline/store/index.ts b/web/app/components/rag-pipeline/store/index.ts
index 5d06543e22..769d7f69f2 100644
--- a/web/app/components/rag-pipeline/store/index.ts
+++ b/web/app/components/rag-pipeline/store/index.ts
@@ -1,6 +1,5 @@
import type { RAGPipelineVariables } from '@/models/pipeline'
import type { StateCreator } from 'zustand'
-import type { ToolWithProvider } from '../../workflow/types'
import { InputVarType } from '../../workflow/types'
export type RagPipelineSliceShape = {
@@ -11,8 +10,6 @@ export type RagPipelineSliceShape = {
setNodesDefaultConfigs: (nodesDefaultConfigs: Record) => void
ragPipelineVariables: RAGPipelineVariables
setRagPipelineVariables: (ragPipelineVariables: RAGPipelineVariables) => void
- dataSourceList: ToolWithProvider[]
- setDataSourceList: (dataSourceList: ToolWithProvider[]) => void
}
export type CreateRagPipelineSliceSlice = StateCreator
@@ -53,6 +50,4 @@ export const createRagPipelineSliceSlice: StateCreator =
}],
}],
setRagPipelineVariables: (ragPipelineVariables: RAGPipelineVariables) => set(() => ({ ragPipelineVariables })),
- dataSourceList: [],
- setDataSourceList: (dataSourceList: ToolWithProvider[]) => set(() => ({ dataSourceList })),
})
diff --git a/web/app/components/workflow/block-selector/index.tsx b/web/app/components/workflow/block-selector/index.tsx
index 949567886d..a618252e7e 100644
--- a/web/app/components/workflow/block-selector/index.tsx
+++ b/web/app/components/workflow/block-selector/index.tsx
@@ -1,9 +1,12 @@
-import { useMemo } from 'react'
+import {
+ useMemo,
+} from 'react'
import type { NodeSelectorProps } from './main'
import NodeSelector from './main'
import { useHooksStore } from '@/app/components/workflow/hooks-store/store'
import { BlockEnum } from '@/app/components/workflow/types'
import { useStore } from '@/app/components/workflow/store'
+import { useDataSourceList } from '@/service/use-pipeline'
const NodeSelectorWrapper = (props: NodeSelectorProps) => {
const availableNodesMetaData = useHooksStore(s => s.availableNodesMetaData)
@@ -28,7 +31,8 @@ const NodeSelectorWrapper = (props: NodeSelectorProps) => {
})
}, [availableNodesMetaData?.nodes])
- const dataSourceList = useStore(s => s.dataSourceList)
+ const pipelineId = useStore(s => s.pipelineId)
+ const { data: dataSourceList } = useDataSourceList(!pipelineId)
return (
({
plugin: require(`./${lang}/plugin`).default,
pluginTags: require(`./${lang}/plugin-tags`).default,
time: require(`./${lang}/time`).default,
+ pipeline: require(`./${lang}/pipeline`).default,
education: requireSilent(lang),
},
})
diff --git a/web/i18n/it-IT/pipeline.ts b/web/i18n/it-IT/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/it-IT/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/ja-JP/pipeline.ts b/web/i18n/ja-JP/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/ja-JP/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/ko-KR/pipeline.ts b/web/i18n/ko-KR/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/ko-KR/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/pl-PL/pipeline.ts b/web/i18n/pl-PL/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/pl-PL/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/pt-BR/pipeline.ts b/web/i18n/pt-BR/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/pt-BR/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/ro-RO/pipeline.ts b/web/i18n/ro-RO/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/ro-RO/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/ru-RU/pipeline.ts b/web/i18n/ru-RU/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/ru-RU/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/sl-SI/pipeline.ts b/web/i18n/sl-SI/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/sl-SI/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/th-TH/pipeline.ts b/web/i18n/th-TH/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/th-TH/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/tr-TR/pipeline.ts b/web/i18n/tr-TR/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/tr-TR/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/uk-UA/pipeline.ts b/web/i18n/uk-UA/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/uk-UA/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/vi-VN/pipeline.ts b/web/i18n/vi-VN/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/vi-VN/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/i18n/zh-Hans/pipeline.ts b/web/i18n/zh-Hans/pipeline.ts
new file mode 100644
index 0000000000..bbb7116d9a
--- /dev/null
+++ b/web/i18n/zh-Hans/pipeline.ts
@@ -0,0 +1,8 @@
+const translation = {
+ common: {
+ goToAddDocuments: '去添加文档',
+ publishAs: '发布为知识管道',
+ },
+}
+
+export default translation
diff --git a/web/i18n/zh-Hant/pipeline.ts b/web/i18n/zh-Hant/pipeline.ts
new file mode 100644
index 0000000000..928649474b
--- /dev/null
+++ b/web/i18n/zh-Hant/pipeline.ts
@@ -0,0 +1,4 @@
+const translation = {
+}
+
+export default translation
diff --git a/web/service/use-pipeline.ts b/web/service/use-pipeline.ts
index 685e7c6fc3..7bd9c927cc 100644
--- a/web/service/use-pipeline.ts
+++ b/web/service/use-pipeline.ts
@@ -16,6 +16,7 @@ import type {
UpdatePipelineInfoRequest,
UpdatePipelineInfoResponse,
} from '@/models/pipeline'
+import type { ToolWithProvider } from '@/app/components/workflow/types'
const NAME_SPACE = 'pipeline'
@@ -126,3 +127,14 @@ export const usePipelineProcessingParams = (pipelineId: string) => {
},
})
}
+
+export const useDataSourceList = (enabled?: boolean) => {
+ return useQuery({
+ enabled,
+ queryKey: [NAME_SPACE, 'data-source'],
+ queryFn: () => {
+ return get('/rag/pipelines/datasource-plugins')
+ },
+ retry: false,
+ })
+}