Files
Dorod-Sky/skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx

53 lines
1.7 KiB
TypeScript
Raw Normal View History

2024-07-12 04:22:28 -07:00
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 (
<div className="space-y-4">
<header>
<h1 className="text-3xl">Rerun Task</h1>
</header>
<CreateNewTaskForm
initialValues={{
url: task.request.url,
2024-12-05 11:56:09 -08:00
navigationGoal: task.request.navigation_goal ?? null,
navigationPayload:
typeof task.request.navigation_payload === "string"
? task.request.navigation_payload
: JSON.stringify(task.request.navigation_payload, null, 2),
2024-12-05 11:56:09 -08:00
dataExtractionGoal: task.request.data_extraction_goal ?? null,
extractedInformationSchema:
typeof task.request.extracted_information_schema === "string"
? task.request.extracted_information_schema
: JSON.stringify(
task.request.extracted_information_schema,
null,
2,
),
2024-12-05 11:56:09 -08:00
webhookCallbackUrl: task.request.webhook_callback_url ?? null,
totpIdentifier: task.request.totp_identifier ?? null,
totpVerificationUrl: task.request.totp_verification_url ?? null,
errorCodeMapping: task.request.error_code_mapping
? JSON.stringify(task.request.error_code_mapping, null, 2)
: "",
2024-12-05 11:56:09 -08:00
proxyLocation: task.request.proxy_location ?? null,
}}
/>
</div>
2024-07-12 04:22:28 -07:00
);
}
export { RetryTask };