mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +08:00
run & tracing
This commit is contained in:
@ -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'
|
||||
|
||||
@ -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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user