fix: handle terminal shell fallback and loopback dashboard UX
- probe sandbox with /bin/sh, /busybox/sh, and env fallback - stop opening loopback-only OpenClaw dashboard URLs in browser - keep operator message for proxy/rebind requirement
This commit is contained in:
@@ -183,7 +183,7 @@ export default function SandboxList({
|
|||||||
setDashboardMessage(data.loopbackOnly
|
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 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}`)
|
: `OpenClaw Dashboard: ${data.dashboardUrl}`)
|
||||||
if (data.dashboardUrl) {
|
if (data.dashboardUrl && !data.loopbackOnly) {
|
||||||
window.open(data.dashboardUrl, '_blank', 'noopener,noreferrer')
|
window.open(data.dashboardUrl, '_blank', 'noopener,noreferrer')
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -20,9 +20,21 @@ export async function dockerExecInOpenShell(command: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function probeSandboxShell(podName: string) {
|
export async function probeSandboxShell(podName: string) {
|
||||||
return dockerExecInOpenShell(
|
const attempts = [
|
||||||
`kubectl -n ${OPENSHELL_NAMESPACE} exec ${podName} -- sh -lc 'echo OPENSHELL_OK && pwd && whoami'`
|
`kubectl -n ${OPENSHELL_NAMESPACE} exec ${podName} -- /bin/sh -lc 'echo OPENSHELL_OK && pwd && whoami'`,
|
||||||
)
|
`kubectl -n ${OPENSHELL_NAMESPACE} exec ${podName} -- /busybox/sh -lc 'echo OPENSHELL_OK && pwd && whoami'`,
|
||||||
|
`kubectl -n ${OPENSHELL_NAMESPACE} exec ${podName} -- env`,
|
||||||
|
]
|
||||||
|
|
||||||
|
let lastError: unknown
|
||||||
|
for (const command of attempts) {
|
||||||
|
try {
|
||||||
|
return await dockerExecInOpenShell(command)
|
||||||
|
} catch (error) {
|
||||||
|
lastError = error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw lastError instanceof Error ? lastError : new Error('Failed to probe sandbox shell')
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getOpenClawDashboardUrl() {
|
export function getOpenClawDashboardUrl() {
|
||||||
|
|||||||
Reference in New Issue
Block a user