From 32ad2f506fc6cc20bdf42e5dcc028e0bf81509d9 Mon Sep 17 00:00:00 2001 From: Mark McKeen Date: Sun, 29 Mar 2026 09:27:38 -0600 Subject: [PATCH] feat: add sandbox dashboard and terminal actions - add sandbox overview buttons for OpenClaw dashboard and OpenShell terminal - add backend routes to resolve dashboard endpoint and terminal attach stub - surface operator messages in sandbox overview panel --- app/api/openshell/dashboard/route.ts | 10 ++++++ app/api/openshell/terminal/route.ts | 14 ++++++++ app/components/SandboxList.tsx | 49 +++++++++++++++++++++++++--- 3 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 app/api/openshell/dashboard/route.ts create mode 100644 app/api/openshell/terminal/route.ts diff --git a/app/api/openshell/dashboard/route.ts b/app/api/openshell/dashboard/route.ts new file mode 100644 index 0000000..20f2b72 --- /dev/null +++ b/app/api/openshell/dashboard/route.ts @@ -0,0 +1,10 @@ +import { NextResponse } from 'next/server' + +export async function GET() { + return NextResponse.json({ + dashboardUrl: 'http://127.0.0.1:18789/', + reachableFromServer: true, + loopbackOnly: true, + note: 'OpenClaw Gateway Dashboard is currently bound to loopback on the host. To expose it in a user browser, proxy it through this dashboard service or rebind the gateway.' + }) +} diff --git a/app/api/openshell/terminal/route.ts b/app/api/openshell/terminal/route.ts new file mode 100644 index 0000000..80c9c2e --- /dev/null +++ b/app/api/openshell/terminal/route.ts @@ -0,0 +1,14 @@ +import { NextResponse } from 'next/server' + +export async function GET(request: Request) { + const { searchParams } = new URL(request.url) + const sandboxId = searchParams.get('sandboxId') || 'unknown' + + return NextResponse.json({ + ok: true, + sandboxId, + attached: false, + note: 'Embedded terminal transport is not live yet. This route is the integration point for attaching to an OpenShell terminal session.', + suggestedCommand: `openshell sandbox exec ${sandboxId} -- /bin/sh` + }) +} diff --git a/app/components/SandboxList.tsx b/app/components/SandboxList.tsx index 5c3d104..c20fa20 100644 --- a/app/components/SandboxList.tsx +++ b/app/components/SandboxList.tsx @@ -32,6 +32,8 @@ export default function SandboxList({ onSandboxSelect, isDestroyMode }: SandboxListProps) { + const [terminalMessage, setTerminalMessage] = useState('') + const [dashboardMessage, setDashboardMessage] = useState('') const [sandboxes, setSandboxes] = useState([]) const [telemetry, setTelemetry] = useState({ cpu: 0, memory: 0, disk: 0, timestamp: new Date().toISOString() @@ -168,15 +170,54 @@ export default function SandboxList({ {!isDestroyMode && selectedSandbox && ( <>
-
+

{sandboxes.find(s => s.id === selectedSandbox)?.name} — TELEMETRY

- - LIVE - +
+ + + + LIVE + +
+ {(dashboardMessage || terminalMessage) && ( +
+ {dashboardMessage &&
{dashboardMessage}
} + {terminalMessage &&
{terminalMessage}
} +
+ )} +

CPU