Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

fix(web): hide "New machine" button on Tauri desktop runtimes page

Gener09bfa72fa323
diff --git a/src/web/src/app/(app)/w/[slug]/runtimes/page.tsx b/src/web/src/app/(app)/w/[slug]/runtimes/page.tsx
index 5e69a13e6..89d9142ee 100644
--- a/src/web/src/app/(app)/w/[slug]/runtimes/page.tsx
+++ b/src/web/src/app/(app)/w/[slug]/runtimes/page.tsx
@@ -26,7 +26,7 @@ import { Skeleton } from "@/components/ui/skeleton";
import { Monitor, Plus } from "lucide-react";
import type { AgentRuntime as Runtime } from "@alook/shared";
-import { semverGte, isTauri, tauriInvoke } from "@alook/shared";
+import { semverGte, isTauri, isDesktop, tauriInvoke } from "@alook/shared";
import { cliCmd, getAppMode } from "@/lib/utils";
import { ProviderLogo } from "@/components/provider-logo";
import { triggerRuntimeUpdate, triggerRuntimeRescan, fetchLatestCliVersion } from "@/lib/api";
@@ -42,6 +42,8 @@ export default function RuntimesPage() {
const pathname = usePathname();
const mode = getAppMode();
const isMobileApp = mode === "mobile";
+ const isTauriDesktop = isTauri() && isDesktop();
+ const hideNewMachine = isMobileApp || isTauriDesktop;
const [sheetOpen, setSheetOpen] = useState(() => searchParams.has("connect"));
const [generatedToken, setGeneratedToken] = useState("");
@@ -273,7 +275,7 @@ export default function RuntimesPage() {
Your machines and their agent runtimes.
</p>
</div>
- {!isMobileApp && (
+ {!hideNewMachine && (
<Button
size="sm"
variant="outline"
@@ -295,11 +297,11 @@ export default function RuntimesPage() {
<div className="flex flex-1 items-center justify-center min-h-[60vh]">
<div className="text-center animate-[fade-up_400ms_ease-out_both]">
<p className="text-muted-foreground text-sm">
- {isMobileApp
+ {hideNewMachine
? "No machines connected. Use the desktop app or CLI to connect a machine."
: "Connect a machine to start running agents locally."}
</p>
- {!isMobileApp && (
+ {!hideNewMachine && (
<Button
size="sm"
className="mt-4 glow-border"