use new run URLs, attempt iii (#3938)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { getClient } from "@/api/AxiosClient";
|
||||
import { WorkflowRunStatusApiResponse } from "@/api/types";
|
||||
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
|
||||
import { useFirstParam } from "@/hooks/useFirstParam";
|
||||
import {
|
||||
statusIsNotFinalized,
|
||||
statusIsRunningOrQueued,
|
||||
@@ -10,7 +11,8 @@ import { useParams } from "react-router-dom";
|
||||
import { useGlobalWorkflowsQuery } from "./useGlobalWorkflowsQuery";
|
||||
|
||||
function useWorkflowRunQuery() {
|
||||
const { workflowRunId, workflowPermanentId } = useParams();
|
||||
const workflowRunId = useFirstParam("workflowRunId", "runId");
|
||||
const { workflowPermanentId } = useParams();
|
||||
const credentialGetter = useCredentialGetter();
|
||||
const { data: globalWorkflows } = useGlobalWorkflowsQuery();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ZoomableImage } from "@/components/ZoomableImage";
|
||||
import { useEffect, useState } from "react";
|
||||
import { statusIsNotFinalized } from "@/routes/tasks/types";
|
||||
import { useCredentialGetter } from "@/hooks/useCredentialGetter";
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useFirstParam } from "@/hooks/useFirstParam";
|
||||
import { getRuntimeApiKey } from "@/util/env";
|
||||
import { toast } from "@/components/ui/use-toast";
|
||||
import { useQueryClient } from "@tanstack/react-query";
|
||||
@@ -25,12 +25,12 @@ const wssBaseUrl = import.meta.env.VITE_WSS_BASE_URL;
|
||||
|
||||
function WorkflowRunStream(props?: Props) {
|
||||
const alwaysShowStream = props?.alwaysShowStream ?? false;
|
||||
const workflowRunId = useFirstParam("workflowRunId", "runId");
|
||||
const { data: workflowRun } = useWorkflowRunWithWorkflowQuery();
|
||||
const [streamImgSrc, setStreamImgSrc] = useState<string>("");
|
||||
const showStream =
|
||||
alwaysShowStream || (workflowRun && statusIsNotFinalized(workflowRun));
|
||||
const credentialGetter = useCredentialGetter();
|
||||
const { workflowRunId } = useParams();
|
||||
const workflow = workflowRun?.workflow;
|
||||
const workflowPermanentId = workflow?.workflow_permanent_id;
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
@@ -94,7 +94,7 @@ function clearRuntimeApiKey(): void {
|
||||
}
|
||||
}
|
||||
|
||||
const useNewRunsUrl = false as const;
|
||||
const useNewRunsUrl = true as const;
|
||||
|
||||
export {
|
||||
apiBaseUrl,
|
||||
|
||||
Reference in New Issue
Block a user