mirror of
https://github.com/langgenius/dify.git
synced 2026-07-30 16:59:35 +08:00
25 lines
523 B
TypeScript
25 lines
523 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,
|
|
}
|
|
}
|