fix(webui): name the gateway sandbox launcher in setup guidance

This commit is contained in:
Xubin Ren committed 2026-11-08 14:29:46 +08:00
1 parent f5e5bd6ea0
commit 44d567e37c
31 files changed
+230 -86

No files matched your search

@@ -11,6 +11,7 @@ import { ToggleButton } from "@/components/ui/toggle-button";
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@/components/ui/alert-dialog";
import { checkSandboxSettings } from "@/lib/api";
import type { NanobotClient } from "@/lib/nanobot-client";
import { sandboxLauncherDisplay } from "@/lib/sandbox-display";
import type { SandboxCheck, SettingsPayload } from "@/lib/types";
import type { RuntimeConfigController } from "./RuntimeConfigSettings";
import type { SettingsFocusTarget } from "@/components/settings/contracts";
@@ -25,8 +26,9 @@ export function SandboxSettings({ settings, state, client, isRestarting, childre
focusTarget?: SettingsFocusTarget;
}) {
const { t } = useTranslation();
const tx = (key: string) => t(`settings.sandbox.${key}`);
const saved = settings.advanced.exec_sandbox_status!;
const launcherName = sandboxLauncherDisplay(saved.supported_backend)?.name ?? t("settings.sandbox.launcher");
const tx = (key: string) => t(`settings.sandbox.${key}`, { launcher: launcherName });
const [result, setResult] = useState<SandboxCheck | null>(null);
const [checking, setChecking] = useState(false);
const [checkError, setCheckError] = useState(false);
@@ -101,7 +103,7 @@ export function SandboxSettings({ settings, state, client, isRestarting, childre
<div className="flex items-start gap-2 text-ui leading-6 text-muted-foreground">
{checking ? <Loader2 className="mt-1 h-4 w-4 shrink-0 animate-spin motion-reduce:animate-none" aria-hidden />
: status === "passed" ? <ShieldCheck className="mt-1 h-4 w-4 shrink-0" aria-hidden /> : <CircleAlert className="mt-1 h-4 w-4 shrink-0" aria-hidden />}
<p>{!saved.supported_backend && enabled ? tx("help.unsupported") : reason ? t(`settings.sandbox.reasons.${reason}`, { defaultValue: tx("reasons.unknown") }) : tx(`help.${dirty ? "unsaved" : status}`)}</p>
<p>{!saved.supported_backend && enabled ? tx("help.unsupported") : reason ? t(`settings.sandbox.reasons.${reason}`, { launcher: launcherName, defaultValue: tx("reasons.unknown") }) : tx(`help.${dirty ? "unsaved" : status}`)}</p>
</div>
{launcher ? <p className="mt-2 break-all font-mono text-caption text-muted-foreground">{launcher}</p> : null}
<p className="mt-2 text-caption leading-5 text-muted-foreground">{tx("scope")}</p>