diff --git a/studio/backend/main.py b/studio/backend/main.py index 65f5e7fe90..7b116cf8d7 100644 --- a/studio/backend/main.py +++ b/studio/backend/main.py @@ -176,12 +176,15 @@ async def health_check(): platform_map = {"darwin": "mac", "win32": "windows", "linux": "linux"} device_type = platform_map.get(sys.platform, sys.platform) + is_docker = os.path.exists("/.dockerenv") + return { "status": "healthy", "timestamp": datetime.now().isoformat(), "service": "Unsloth UI Backend", "device_type": device_type, "chat_only": _hw_module.CHAT_ONLY, + "is_docker": is_docker, } diff --git a/studio/frontend/src/components/navbar.tsx b/studio/frontend/src/components/navbar.tsx index 99909b80fa..4958ae2258 100644 --- a/studio/frontend/src/components/navbar.tsx +++ b/studio/frontend/src/components/navbar.tsx @@ -55,6 +55,7 @@ export function Navbar() { const [shutdownOpen, setShutdownOpen] = useState(false); const chatOnly = usePlatformStore((s) => s.isChatOnly()); + const isDocker = usePlatformStore((s) => s.isDocker); // Warn before closing the tab only when training is running (data loss risk). // We store the handler in a ref so removeUnloadHandler() can clean it up @@ -236,15 +237,17 @@ export function Navbar() { Tour - + {!isDocker && ( + + )} {/* Right: mobile */} @@ -331,17 +334,19 @@ export function Navbar() { Start tour ) : null} - + {!isDocker && ( + + )}
Theme boolean; } @@ -24,6 +25,7 @@ interface PlatformState { export const usePlatformStore = create()((_, get) => ({ deviceType: "linux", chatOnly: false, + isDocker: false, fetched: false, isChatOnly: () => get().chatOnly, })); @@ -35,10 +37,11 @@ export async function fetchDeviceType(): Promise { try { const res = await fetch("/api/health"); if (res.ok) { - const data = (await res.json()) as { device_type?: string; chat_only?: boolean }; + const data = (await res.json()) as { device_type?: string; chat_only?: boolean; is_docker?: boolean }; const deviceType = data.device_type ?? "linux"; const chatOnly = data.chat_only ?? deviceType === "mac"; - usePlatformStore.setState({ deviceType, chatOnly, fetched: true }); + const isDocker = data.is_docker ?? false; + usePlatformStore.setState({ deviceType, chatOnly, isDocker, fetched: true }); return deviceType; } } catch (err) {