mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-05 08:10:39 +00:00
Add Terminal dropdown button to run detail page
Adds a sandboxId field to RunItem and a Terminal dropdown on the run detail page with "Web Terminal" (links to Daytona proxy) and "Connect with SSH" options. Uses existing Headless UI Menu pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
726ab184dc
commit
1aca8231bc
2 changed files with 47 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ export interface RunItem {
|
|||
actionDisabled?: boolean;
|
||||
comments?: number;
|
||||
question?: string;
|
||||
sandboxId?: string;
|
||||
}
|
||||
|
||||
export type ColumnStatus = "working" | "pending" | "review" | "merge";
|
||||
|
|
@ -62,6 +63,7 @@ export const columns: {
|
|||
workflow: "implement",
|
||||
resources: "4 CPU / 8 GB",
|
||||
elapsed: "7m",
|
||||
sandboxId: "sb-a1b2c3d4",
|
||||
},
|
||||
{
|
||||
id: "run-2",
|
||||
|
|
@ -70,6 +72,7 @@ export const columns: {
|
|||
workflow: "implement",
|
||||
resources: "8 CPU / 16 GB",
|
||||
elapsed: "2h 15m",
|
||||
sandboxId: "sb-e5f6g7h8",
|
||||
},
|
||||
{
|
||||
id: "run-3",
|
||||
|
|
@ -78,6 +81,7 @@ export const columns: {
|
|||
workflow: "fix_build",
|
||||
resources: "2 CPU / 4 GB",
|
||||
elapsed: "45m",
|
||||
sandboxId: "sb-i9j0k1l2",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -98,6 +102,7 @@ export const columns: {
|
|||
deletions: 234,
|
||||
elapsed: "1h 12m",
|
||||
question: "Accept or push for another round?",
|
||||
sandboxId: "sb-q7r8s9t0",
|
||||
},
|
||||
{
|
||||
id: "run-5",
|
||||
|
|
@ -108,6 +113,7 @@ export const columns: {
|
|||
deletions: 23,
|
||||
elapsed: "28m",
|
||||
question: "Proceed from investigation to fix?",
|
||||
sandboxId: "sb-u1v2w3x4",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -127,6 +133,7 @@ export const columns: {
|
|||
number: 889,
|
||||
additions: 234,
|
||||
deletions: 67,
|
||||
sandboxId: "sb-m3n4o5p6",
|
||||
checks: [
|
||||
{ name: "lint", status: "success", duration: "23s" },
|
||||
{ name: "typecheck", status: "success", duration: "1m 12s" },
|
||||
|
|
@ -155,6 +162,7 @@ export const columns: {
|
|||
{ name: "build", status: "pending" },
|
||||
],
|
||||
elapsed: "12m",
|
||||
sandboxId: "sb-y5z6a7b8",
|
||||
actionDisabled: true,
|
||||
comments: 1,
|
||||
},
|
||||
|
|
@ -190,6 +198,7 @@ export const columns: {
|
|||
{ name: "bundle-size", status: "success", duration: "34s" },
|
||||
{ name: "accessibility", status: "success", duration: "1m 12s" },
|
||||
],
|
||||
sandboxId: "sb-c9d0e1f2",
|
||||
elapsed: "3d",
|
||||
elapsedWarning: true,
|
||||
comments: 7,
|
||||
|
|
@ -210,6 +219,7 @@ export const columns: {
|
|||
{ name: "coverage", status: "success", duration: "2m 4s" },
|
||||
{ name: "bundle-size", status: "skipped" },
|
||||
],
|
||||
sandboxId: "sb-g3h4i5j6",
|
||||
elapsed: "1h 5m",
|
||||
comments: 2,
|
||||
},
|
||||
|
|
@ -227,6 +237,7 @@ export const columns: {
|
|||
{ name: "unit-tests", status: "success", duration: "1m 15s" },
|
||||
{ name: "build", status: "success", duration: "58s" },
|
||||
],
|
||||
sandboxId: "sb-k7l8m9n0",
|
||||
elapsed: "48m",
|
||||
comments: 0,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { ChevronRightIcon } from "@heroicons/react/20/solid";
|
||||
import { ChevronDownIcon, ChevronRightIcon } from "@heroicons/react/20/solid";
|
||||
import { Menu, MenuButton, MenuItem, MenuItems } from "@headlessui/react";
|
||||
import { Link, Outlet, useLocation } from "react-router";
|
||||
import { findRun, statusColors } from "../data/runs";
|
||||
import { workflowData } from "./workflow-detail";
|
||||
|
|
@ -67,6 +68,40 @@ export default function RunDetail({ params }: Route.ComponentProps) {
|
|||
</svg>
|
||||
Open PR
|
||||
</button>
|
||||
{run.sandboxId && (
|
||||
<Menu as="div" className="relative">
|
||||
<MenuButton className="flex shrink-0 items-center gap-1.5 rounded-md border border-teal-500/20 px-3 py-1.5 text-sm font-medium text-teal-500 transition-colors hover:border-teal-500/50 hover:bg-teal-500/10 hover:text-fg">
|
||||
<svg viewBox="0 0 16 16" fill="currentColor" className="size-3.5" aria-hidden="true">
|
||||
<path d="M0 2.75C0 1.784.784 1 1.75 1h12.5c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0 1 14.25 15H1.75A1.75 1.75 0 0 1 0 13.25Zm1.75-.25a.25.25 0 0 0-.25.25v10.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V2.75a.25.25 0 0 0-.25-.25ZM7.25 8a.749.749 0 0 1-.22.53l-2.25 2.25a.749.749 0 1 1-1.06-1.06L5.44 8 3.72 6.28a.749.749 0 1 1 1.06-1.06l2.25 2.25c.141.14.22.331.22.53Zm1.5 1.5h3a.75.75 0 0 1 0 1.5h-3a.75.75 0 0 1 0-1.5Z" />
|
||||
</svg>
|
||||
Terminal
|
||||
<ChevronDownIcon className="size-4" aria-hidden="true" />
|
||||
</MenuButton>
|
||||
<MenuItems
|
||||
transition
|
||||
className="absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-panel py-1 outline-1 -outline-offset-1 outline-line-strong transition data-closed:scale-95 data-closed:transform data-closed:opacity-0 data-enter:duration-100 data-enter:ease-out data-leave:duration-75 data-leave:ease-in"
|
||||
>
|
||||
<MenuItem>
|
||||
<a
|
||||
href="https://22222-rjyrtjg8gelfyo1p.daytonaproxy01.net/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="block px-4 py-2 text-sm text-fg-3 data-focus:bg-overlay data-focus:text-fg"
|
||||
>
|
||||
Web Terminal
|
||||
</a>
|
||||
</MenuItem>
|
||||
<MenuItem>
|
||||
<button
|
||||
type="button"
|
||||
className="block w-full px-4 py-2 text-left text-sm text-fg-3 data-focus:bg-overlay data-focus:text-fg"
|
||||
>
|
||||
Connect with SSH
|
||||
</button>
|
||||
</MenuItem>
|
||||
</MenuItems>
|
||||
</Menu>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="border-b border-line">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue