run & tracing

This commit is contained in:
zxhlyh
2025-05-29 14:31:00 +08:00
parent 9176790adf
commit 1c2c4b62f8
12 changed files with 92 additions and 27 deletions

View File

@ -6,3 +6,4 @@ export * from './use-workflow-start-run'
export * from './use-is-chat-mode'
export * from './use-available-nodes-meta-data'
export * from './use-workflow-refresh-draft'
export * from './use-get-run-and-trace-url'

View File

@ -0,0 +1,18 @@
import { useCallback } from 'react'
import { useWorkflowStore } from '@/app/components/workflow/store'
export const useGetRunAndTraceUrl = () => {
const workflowStore = useWorkflowStore()
const getWorkflowRunAndTraceUrl = useCallback((runId: string) => {
const { appId } = workflowStore.getState()
return {
runUrl: `/apps/${appId}/workflow-runs/${runId}`,
traceUrl: `/apps/${appId}/workflow-runs/${runId}/node-executions`,
}
}, [workflowStore])
return {
getWorkflowRunAndTraceUrl,
}
}