pull/21398/head
zxhlyh 11 months ago
parent 71ce505631
commit 6ff6525d1d

@ -9,7 +9,7 @@ import VectorSpaceFull from '@/app/components/billing/vector-space-full'
import WebsiteCrawl from './data-source/website-crawl' import WebsiteCrawl from './data-source/website-crawl'
import Actions from './data-source/actions' import Actions from './data-source/actions'
import DocumentProcessing from './document-processing' import DocumentProcessing from './document-processing'
import { usePipelineRun } from '../../../hooks' import { useWorkflowRun } from '@/app/components/workflow/hooks'
import type { Datasource } from './types' import type { Datasource } from './types'
import { DatasourceType } from '@/models/pipeline' import { DatasourceType } from '@/models/pipeline'
import { TransferMethod } from '@/types/app' import { TransferMethod } from '@/types/app'
@ -44,7 +44,7 @@ const TestRunPanel = () => {
setWebsitePages, setWebsitePages,
setWebsiteCrawlJobId, setWebsiteCrawlJobId,
} = useWebsiteCrawl() } = useWebsiteCrawl()
const { handleRun } = usePipelineRun() const { handleRun } = useWorkflowRun()
const isVectorSpaceFull = plan.usage.vectorSpace >= plan.total.vectorSpace const isVectorSpaceFull = plan.usage.vectorSpace >= plan.total.vectorSpace
const isShowVectorSpaceFull = allFileLoaded && isVectorSpaceFull && enableBilling const isShowVectorSpaceFull = allFileLoaded && isVectorSpaceFull && enableBilling

@ -3,6 +3,7 @@ import {
useCallback, useCallback,
useMemo, useMemo,
} from 'react' } from 'react'
import { useTranslation } from 'react-i18next'
import type { HeaderProps } from '@/app/components/workflow/header' import type { HeaderProps } from '@/app/components/workflow/header'
import Header from '@/app/components/workflow/header' import Header from '@/app/components/workflow/header'
import { fetchWorkflowRunHistory } from '@/service/workflow' import { fetchWorkflowRunHistory } from '@/service/workflow'
@ -14,6 +15,7 @@ import InputFieldButton from './input-field-button'
import Publisher from './publisher' import Publisher from './publisher'
const RagPipelineHeader = () => { const RagPipelineHeader = () => {
const { t } = useTranslation()
const workflowStore = useWorkflowStore() const workflowStore = useWorkflowStore()
const pipelineId = useStore(s => s.pipelineId) const pipelineId = useStore(s => s.pipelineId)
const showDebugAndPreviewPanel = useStore(s => s.showDebugAndPreviewPanel) const showDebugAndPreviewPanel = useStore(s => s.showDebugAndPreviewPanel)
@ -39,7 +41,7 @@ const RagPipelineHeader = () => {
}, },
runAndHistoryProps: { runAndHistoryProps: {
showRunButton: true, showRunButton: true,
runButtonText: 'Test Run', runButtonText: t('workflow.singleRun.testRun'),
viewHistoryProps, viewHistoryProps,
isRunning: showDebugAndPreviewPanel, isRunning: showDebugAndPreviewPanel,
onStopRun: handleStopRun, onStopRun: handleStopRun,
@ -49,7 +51,7 @@ const RagPipelineHeader = () => {
viewHistoryProps, viewHistoryProps,
}, },
} }
}, [viewHistoryProps, showDebugAndPreviewPanel, handleStopRun]) }, [viewHistoryProps, showDebugAndPreviewPanel, handleStopRun, t])
return ( return (
<Header {...headerProps} /> <Header {...headerProps} />

Loading…
Cancel
Save