You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

use-get-run-and-trace-url.ts 526B

5 月之前
123456789101112131415161718
  1. import { useCallback } from 'react'
  2. import { useWorkflowStore } from '@/app/components/workflow/store'
  3. export const useGetRunAndTraceUrl = () => {
  4. const workflowStore = useWorkflowStore()
  5. const getWorkflowRunAndTraceUrl = useCallback((runId: string) => {
  6. const { appId } = workflowStore.getState()
  7. return {
  8. runUrl: `/apps/${appId}/workflow-runs/${runId}`,
  9. traceUrl: `/apps/${appId}/workflow-runs/${runId}/node-executions`,
  10. }
  11. }, [workflowStore])
  12. return {
  13. getWorkflowRunAndTraceUrl,
  14. }
  15. }