Initial implementation of TriggerShell
A Python CLI (typer) that bootstraps Node/pnpm and launches a Next.js 16 web app for running configured shell scripts: YAML config validated by a shared Zod schema, dynamic per-script forms mapped to shadcn controls, argv-safe execa execution with live WebSocket streaming, SQLite/Drizzle run history, and optional argon2 session + API token auth. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import type { RunStatus } from "@/lib/db/schema";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const styles: Record<RunStatus, string> = {
|
||||
queued: "bg-muted text-muted-foreground",
|
||||
running: "bg-blue-500/15 text-blue-600 dark:text-blue-400",
|
||||
succeeded: "bg-emerald-500/15 text-emerald-600 dark:text-emerald-400",
|
||||
failed: "bg-destructive/15 text-destructive",
|
||||
cancelled: "bg-muted text-muted-foreground",
|
||||
timed_out: "bg-amber-500/15 text-amber-600 dark:text-amber-400",
|
||||
interrupted: "bg-amber-500/15 text-amber-600 dark:text-amber-400",
|
||||
};
|
||||
|
||||
const labels: Record<RunStatus, string> = {
|
||||
queued: "Queued",
|
||||
running: "Running",
|
||||
succeeded: "Succeeded",
|
||||
failed: "Failed",
|
||||
cancelled: "Cancelled",
|
||||
timed_out: "Timed out",
|
||||
interrupted: "Interrupted",
|
||||
};
|
||||
|
||||
export function RunStatusBadge({ status }: { status: RunStatus }) {
|
||||
return (
|
||||
<Badge
|
||||
className={cn("border-transparent font-medium", styles[status])}
|
||||
variant="outline"
|
||||
>
|
||||
{status === "running" && (
|
||||
<span className="mr-1 inline-block size-1.5 animate-pulse rounded-full bg-current" />
|
||||
)}
|
||||
{labels[status]}
|
||||
</Badge>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user