mirror of
https://github.com/langgenius/dify.git
synced 2026-05-12 07:37:09 +08:00
22 lines
488 B
TypeScript
22 lines
488 B
TypeScript
import { useCallback } from 'react'
|
|
|
|
export const useGetRunAndTraceUrl = (snippetId: string) => {
|
|
const getWorkflowRunAndTraceUrl = useCallback((runId?: string) => {
|
|
if (!runId) {
|
|
return {
|
|
runUrl: '',
|
|
traceUrl: '',
|
|
}
|
|
}
|
|
|
|
return {
|
|
runUrl: `/snippets/${snippetId}/workflow-runs/${runId}`,
|
|
traceUrl: `/snippets/${snippetId}/workflow-runs/${runId}/node-executions`,
|
|
}
|
|
}, [snippetId])
|
|
|
|
return {
|
|
getWorkflowRunAndTraceUrl,
|
|
}
|
|
}
|