mirror of
https://github.com/langgenius/dify.git
synced 2026-08-28 20:03:22 +08:00
Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
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,
|
|
}
|
|
}
|