Added a Sample Next Step in the job gear dropdown to force a sample on the next step.

This commit is contained in:
Jaret Burkett
2026-07-17 07:59:30 -06:00
parent 7a3d94ed03
commit 988d891102
5 changed files with 88 additions and 3 deletions

View File

@@ -1,9 +1,9 @@
import Link from 'next/link';
import { Eye, Trash2, Pen, Play, Pause, Cog, X, Copy, Save, OctagonX } from 'lucide-react';
import { Eye, Trash2, Pen, Play, Pause, Cog, X, Copy, Save, OctagonX, Image } from 'lucide-react';
import { Button } from '@headlessui/react';
import { openConfirm } from '@/components/ConfirmModal';
import { Job } from '@prisma/client';
import { startJob, stopJob, deleteJob, getAvaliableJobActions, markJobAsStopped, saveJobNow } from '@/utils/jobs';
import { startJob, stopJob, deleteJob, getAvaliableJobActions, markJobAsStopped, saveJobNow, sampleJobNow } from '@/utils/jobs';
import { startQueue } from '@/utils/queue';
import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/react';
import { redirect } from 'next/navigation';
@@ -146,7 +146,7 @@ export default function JobActionBar({
</MenuButton>
<MenuItems
anchor={{ to: menuAnchor, gap: 16 }}
className="bg-gray-900 border border-gray-700 rounded shadow-lg w-52 px-2 py-2 z-50"
className="bg-gray-900 border border-gray-700 rounded shadow-lg w-60 px-2 py-2 z-50"
>
{job.job_type === 'train' && (
<MenuItem>
@@ -173,6 +173,20 @@ export default function JobActionBar({
</div>
</MenuItem>
)}
{job.job_type === 'train' && canStop && (
<MenuItem>
<div
className="cursor-pointer px-4 py-1 hover:bg-gray-800 rounded flex items-center gap-2"
onClick={async () => {
await sampleJobNow(job.id);
if (onRefresh) onRefresh();
}}
>
<Image className="w-4 h-4" />
Sample Next Step
</div>
</MenuItem>
)}
<MenuItem>
<div
className="cursor-pointer px-4 py-1 hover:bg-gray-800 rounded flex items-center gap-2"