- Delete any model (incl. failed ones); the worker removes the repo's files (keeps foreign files and empty-folder cleanup), then the rows. - Verify (existence, size, hf metadata) and deep verify (SHA-256 / git blob SHA-1 against the Hub) with missing/mismatch/extra report. - Repair = download of the selection; broken files are deleted first because hf skips files whose metadata matches without checking them. - Hub check resolves the tracked revision and stores which selected files a newer commit changes/adds/removes; Update pins it (old commit kept in model_revisions), downloads, then removes dropped files. - Worker runs verify/delete jobs next to downloads (2 local slots). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
54 lines
1.8 KiB
TypeScript
54 lines
1.8 KiB
TypeScript
"use client";
|
|
|
|
import Link from "next/link";
|
|
import { JobStateBadge } from "@/components/job-progress";
|
|
import { LocalTime } from "@/components/local-time";
|
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
|
import { useLive } from "@/hooks/use-live";
|
|
import { formatBytes } from "@/lib/format";
|
|
import { jobLabel } from "@/lib/job-labels";
|
|
|
|
/** Job history of one model (live). */
|
|
export function JobsTab({ modelId }: { modelId: string }) {
|
|
const { snapshot } = useLive({ model: modelId });
|
|
const jobs = snapshot?.jobs ?? [];
|
|
|
|
if (snapshot && jobs.length === 0) {
|
|
return <p className="py-6 text-sm text-muted-foreground">No jobs yet.</p>;
|
|
}
|
|
return (
|
|
<Table>
|
|
<TableHeader>
|
|
<TableRow>
|
|
<TableHead>Started</TableHead>
|
|
<TableHead>Kind</TableHead>
|
|
<TableHead>State</TableHead>
|
|
<TableHead className="text-right">Size</TableHead>
|
|
<TableHead className="hidden sm:table-cell">Finished</TableHead>
|
|
</TableRow>
|
|
</TableHeader>
|
|
<TableBody>
|
|
{jobs.map((j) => (
|
|
<TableRow key={j.id}>
|
|
<TableCell>
|
|
<Link href={`/jobs/${j.id}`} className="hover:underline">
|
|
<LocalTime value={j.startedAt ?? j.createdAt} />
|
|
</Link>
|
|
</TableCell>
|
|
<TableCell className="text-sm">
|
|
{jobLabel(j)}
|
|
</TableCell>
|
|
<TableCell>
|
|
<JobStateBadge job={j} />
|
|
</TableCell>
|
|
<TableCell className="text-right text-sm tabular-nums">{formatBytes(j.totalBytes)}</TableCell>
|
|
<TableCell className="hidden text-sm text-muted-foreground sm:table-cell">
|
|
<LocalTime value={j.finishedAt} />
|
|
</TableCell>
|
|
</TableRow>
|
|
))}
|
|
</TableBody>
|
|
</Table>
|
|
);
|
|
}
|