added progress bar and scheduler
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
export function JobStatusPanel({ job }) {
|
||||
const percent = Math.round(job?.progress?.percent || 0);
|
||||
|
||||
return (
|
||||
<section className="rounded-md border border-zinc-800 bg-zinc-900/70">
|
||||
<div className="flex items-center justify-between border-b border-zinc-800 px-4 py-3">
|
||||
@@ -11,13 +13,25 @@ export function JobStatusPanel({ job }) {
|
||||
<dl className="space-y-3 text-sm">
|
||||
<Info label="Type" value={job?.type || '-'} />
|
||||
<Info label="Current Step" value={job?.currentStep || 'No active job'} />
|
||||
<Info label="Progress" value={job ? `${percent}%` : '-'} />
|
||||
<Info label="Started" value={formatTime(job?.startedAt)} />
|
||||
<Info label="Finished" value={formatTime(job?.finishedAt)} />
|
||||
{job?.error ? <Info label="Error" value={job.error} tone="text-red-300" /> : null}
|
||||
</dl>
|
||||
<pre className="max-h-80 overflow-auto rounded-md border border-zinc-800 bg-zinc-950 p-3 text-xs leading-5 text-zinc-300">
|
||||
{(job?.logs || ['No logs yet.']).join('\n')}
|
||||
</pre>
|
||||
<div className="space-y-3">
|
||||
<div className="rounded-md border border-zinc-800 bg-zinc-950 p-3">
|
||||
<div className="mb-2 flex items-center justify-between gap-3 text-xs text-zinc-400">
|
||||
<span>{job?.progress?.detail || job?.currentStep || 'No active job'}</span>
|
||||
<span className="font-mono text-zinc-300">{job ? `${percent}%` : '-'}</span>
|
||||
</div>
|
||||
<div className="h-2 overflow-hidden rounded-md bg-zinc-800">
|
||||
<div className="h-full bg-cyan-400 transition-all" style={{ width: `${job ? percent : 0}%` }} />
|
||||
</div>
|
||||
</div>
|
||||
<pre className="max-h-80 overflow-auto rounded-md border border-zinc-800 bg-zinc-950 p-3 text-xs leading-5 text-zinc-300">
|
||||
{(job?.logs || ['No logs yet.']).join('\n')}
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user