feat: add backend-local OpenShell host helpers

- execute Docker/Kubectl from dashboard backend on host
- add dashboard open endpoint and terminal probe endpoint
- wire sandbox action buttons to backend-local helpers
This commit is contained in:
Mark McKeen
2026-03-29 09:40:42 -06:00
parent 32ad2f506f
commit dad980f18f
4 changed files with 84 additions and 3 deletions
+10 -3
View File
@@ -178,11 +178,14 @@ export default function SandboxList({
<button
onClick={async () => {
try {
const res = await fetch('/api/openshell/dashboard')
const res = await fetch('/api/openshell/dashboard/open')
const data = await res.json()
setDashboardMessage(data.loopbackOnly
? `OpenClaw Dashboard detected at ${data.dashboardUrl}. It is loopback-only, so the next step is adding a proxy/open-in-new-tab bridge.`
: `OpenClaw Dashboard: ${data.dashboardUrl}`)
if (data.dashboardUrl) {
window.open(data.dashboardUrl, '_blank', 'noopener,noreferrer')
}
} catch (error) {
setDashboardMessage('Failed to resolve OpenClaw Dashboard endpoint.')
}
@@ -194,9 +197,13 @@ export default function SandboxList({
<button
onClick={async () => {
try {
const res = await fetch(`/api/openshell/terminal?sandboxId=${encodeURIComponent(selectedSandbox)}`)
const res = await fetch(`/api/openshell/terminal/open?sandboxId=${encodeURIComponent(selectedSandbox)}`)
const data = await res.json()
setTerminalMessage(data.note || 'Terminal attach route reached.')
if (data.ok) {
setTerminalMessage(`Terminal probe succeeded for ${selectedSandbox}: ${data.output || 'attached'}`)
} else {
setTerminalMessage(data.error || 'Failed to attach to OpenShell terminal.')
}
} catch (error) {
setTerminalMessage('Failed to attach to OpenShell terminal.')
}