mirror of
https://github.com/langgenius/dify.git
synced 2026-04-26 10:16:40 +08:00
fix type of workflow process
This commit is contained in:
parent
40775e27ce
commit
8dc8650ecb
@ -27,14 +27,10 @@ import WorkflowProcessItem from '@/app/components/base/chat/chat/answer/workflow
|
|||||||
import type { WorkflowProcess } from '@/app/components/base/chat/types'
|
import type { WorkflowProcess } from '@/app/components/base/chat/types'
|
||||||
|
|
||||||
const MAX_DEPTH = 3
|
const MAX_DEPTH = 3
|
||||||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
|
|
||||||
export interface WorkflowProcessData extends WorkflowProcess {
|
|
||||||
expand: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export type IGenerationItemProps = {
|
export type IGenerationItemProps = {
|
||||||
isWorkflow?: boolean
|
isWorkflow?: boolean
|
||||||
workflowProcessData?: WorkflowProcessData
|
workflowProcessData?: WorkflowProcess
|
||||||
className?: string
|
className?: string
|
||||||
isError: boolean
|
isError: boolean
|
||||||
onRetry: () => void
|
onRetry: () => void
|
||||||
|
|||||||
@ -53,6 +53,7 @@ export type ChatConfig = Omit<ModelConfig, 'model'> & {
|
|||||||
export type WorkflowProcess = {
|
export type WorkflowProcess = {
|
||||||
status: WorkflowRunningStatus
|
status: WorkflowRunningStatus
|
||||||
tracing: NodeTracing[]
|
tracing: NodeTracing[]
|
||||||
|
expand?: boolean // for UI
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ChatItem = IChatItem & {
|
export type ChatItem = IChatItem & {
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { useBoolean } from 'ahooks'
|
|||||||
import { t } from 'i18next'
|
import { t } from 'i18next'
|
||||||
import produce from 'immer'
|
import produce from 'immer'
|
||||||
import cn from 'classnames'
|
import cn from 'classnames'
|
||||||
import TextGenerationRes, { type WorkflowProcessData } from '@/app/components/app/text-generate/item'
|
import TextGenerationRes from '@/app/components/app/text-generate/item'
|
||||||
import NoData from '@/app/components/share/text-generation/no-data'
|
import NoData from '@/app/components/share/text-generation/no-data'
|
||||||
import Toast from '@/app/components/base/toast'
|
import Toast from '@/app/components/base/toast'
|
||||||
import { sendCompletionMessage, sendWorkflowMessage, updateFeedback } from '@/service/share'
|
import { sendCompletionMessage, sendWorkflowMessage, updateFeedback } from '@/service/share'
|
||||||
@ -16,6 +16,7 @@ import type { InstalledApp } from '@/models/explore'
|
|||||||
import type { ModerationService } from '@/models/common'
|
import type { ModerationService } from '@/models/common'
|
||||||
import { TransferMethod, type VisionFile, type VisionSettings } from '@/types/app'
|
import { TransferMethod, type VisionFile, type VisionSettings } from '@/types/app'
|
||||||
import { BlockEnum, NodeRunningStatus, WorkflowRunningStatus } from '@/app/components/workflow/types'
|
import { BlockEnum, NodeRunningStatus, WorkflowRunningStatus } from '@/app/components/workflow/types'
|
||||||
|
import type { WorkflowProcess } from '@/app/components/base/chat/types'
|
||||||
|
|
||||||
export type IResultProps = {
|
export type IResultProps = {
|
||||||
isWorkflow: boolean
|
isWorkflow: boolean
|
||||||
@ -77,9 +78,9 @@ const Result: FC<IResultProps> = ({
|
|||||||
doSetCompletionRes(res)
|
doSetCompletionRes(res)
|
||||||
}
|
}
|
||||||
const getCompletionRes = () => completionResRef.current
|
const getCompletionRes = () => completionResRef.current
|
||||||
const [workflowProcessData, doSetWorkflowProccessData] = useState<WorkflowProcessData>()
|
const [workflowProcessData, doSetWorkflowProccessData] = useState<WorkflowProcess>()
|
||||||
const workflowProcessDataRef = useRef<WorkflowProcessData>()
|
const workflowProcessDataRef = useRef<WorkflowProcess>()
|
||||||
const setWorkflowProccessData = (data: WorkflowProcessData) => {
|
const setWorkflowProccessData = (data: WorkflowProcess) => {
|
||||||
workflowProcessDataRef.current = data
|
workflowProcessDataRef.current = data
|
||||||
doSetWorkflowProccessData(data)
|
doSetWorkflowProccessData(data)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,7 @@ export type NodeTracing = {
|
|||||||
email: string
|
email: string
|
||||||
}
|
}
|
||||||
finished_at: number
|
finished_at: number
|
||||||
|
expand?: boolean // for UI
|
||||||
}
|
}
|
||||||
|
|
||||||
export type FetchWorkflowDraftResponse = {
|
export type FetchWorkflowDraftResponse = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user