Implement retry task (#600)
This commit is contained in:
41
skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx
Normal file
41
skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import { useParams } from "react-router-dom";
|
||||
import { useTaskQuery } from "../../detail/hooks/useTaskQuery";
|
||||
import { CreateNewTaskForm } from "../CreateNewTaskForm";
|
||||
|
||||
function RetryTask() {
|
||||
const { taskId } = useParams();
|
||||
const { data: task, isLoading } = useTaskQuery({ id: taskId });
|
||||
|
||||
if (isLoading) {
|
||||
return <div>Fetching task details...</div>;
|
||||
}
|
||||
|
||||
if (!task) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<CreateNewTaskForm
|
||||
initialValues={{
|
||||
url: task.request.url,
|
||||
navigationGoal: task.request.navigation_goal,
|
||||
navigationPayload:
|
||||
typeof task.request.navigation_payload === "string"
|
||||
? task.request.navigation_payload
|
||||
: JSON.stringify(task.request.navigation_payload, null, 2),
|
||||
dataExtractionGoal: task.request.data_extraction_goal,
|
||||
extractedInformationSchema:
|
||||
typeof task.request.extracted_information_schema === "string"
|
||||
? task.request.extracted_information_schema
|
||||
: JSON.stringify(
|
||||
task.request.extracted_information_schema,
|
||||
null,
|
||||
2,
|
||||
),
|
||||
webhookCallbackUrl: task.request.webhook_callback_url,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export { RetryTask };
|
||||
Reference in New Issue
Block a user