From 51467925f37fca35a749d52c96059a4ed5254f5b Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 12 Jul 2025 10:47:51 +0000 Subject: [PATCH] Enable parallel job execution. Add UI element to specify parallel job count and utilize the `parallel` field in `indjob` to divide runtime accordingly. --- src/components/JobForm.tsx | 22 +++++++++++++++++++--- src/lib/types.ts | 1 + src/services/facilityService.ts | 30 ------------------------------ 3 files changed, 20 insertions(+), 33 deletions(-) delete mode 100644 src/services/facilityService.ts diff --git a/src/components/JobForm.tsx b/src/components/JobForm.tsx index ae44e11..20f0a8c 100644 --- a/src/components/JobForm.tsx +++ b/src/components/JobForm.tsx @@ -23,7 +23,8 @@ const JobForm: React.FC = ({ job, onSubmit, onCancel }) => { status: job?.status || IndJobStatusOptions.Planned, projectedCost: job?.projectedCost || 0, projectedRevenue: job?.projectedRevenue || 0, - runtime: job?.runtime || 0 + runtime: job?.runtime || 0, + parallel: job?.parallel || 1 }); const [jobDump, setJobDump] = useState(''); @@ -102,7 +103,8 @@ const JobForm: React.FC = ({ job, onSubmit, onCancel }) => { status: formData.status, projectedCost: formData.projectedCost, projectedRevenue: formData.projectedRevenue, - runtime: formData.runtime + runtime: formData.runtime, + parallel: formData.parallel }, parsedBillOfMaterials.length > 0 ? parsedBillOfMaterials : undefined); }; @@ -166,7 +168,7 @@ const JobForm: React.FC = ({ job, onSubmit, onCancel }) => { -
+
= ({ job, onSubmit, onCancel }) => { className="bg-gray-800 border-gray-600 text-white" />
+
+ + setFormData({ + ...formData, + parallel: Math.max(1, parseInt(e.target.value) || 1) + })} + className="bg-gray-800 border-gray-600 text-white" + /> +
{ - const result = await pb.collection('ind_facility').getFullList(); - return result as IndFacilityResponse[]; -} - -export async function getFacility(id: string): Promise { - try { - return await pb.collection('ind_facility').getOne(id) as IndFacilityResponse; - } catch (e) { - if (e.status === 404) return null; - throw e; - } -} - -export async function createFacility(facility: Omit): Promise { - return await pb.collection('ind_facility').create(facility) as IndFacilityResponse; -} - -export async function updateFacility(id: string, updates: Partial): Promise { - return await pb.collection('ind_facility').update(id, updates) as IndFacilityResponse; -} - -export async function deleteFacility(id: string): Promise { - await pb.collection('ind_facility').delete(id); -}