+ {command}
+
+
+ - {query ? "No service matches." : `${name} has no projects yet.`} -
- ) : null} + {!inventory && state.phase !== "lost" ? ( ++ {query ? "No service matches." : `${name} has no projects yet.`} +
+ ) : null} - {outputItem ? ( - <> - {/* Keeps the last cards scrollable above the panel. */} - -{quick.text}
; + case "command": + return ( +{remoteErrorMessage(code, name, "Not available.")}
+Update Localify on {name} to ask from here.
+{remoteErrorMessage(code, name, "Not available.")}
+Or run this on {name}:
++ {item.service.name} started before this version of Localify on {name}. +
+ {quick.access ? ( ++ {remoteErrorMessage(code, name, "")} Relaunching asks {name} for access first. +
+ ) : null} +Or run this on {name}:
++ {view.text} +
+ ); +} diff --git a/desktop-ui/src/components/app/remote/remote-service-chip.tsx b/desktop-ui/src/components/app/remote/remote-service-chip.tsx index cc14fbd7..b29f80d5 100644 --- a/desktop-ui/src/components/app/remote/remote-service-chip.tsx +++ b/desktop-ui/src/components/app/remote/remote-service-chip.tsx @@ -1,7 +1,7 @@ "use client"; import { useQuery } from "@tanstack/react-query"; -import { useState } from "react"; +import { useRef, useState } from "react"; import { toast } from "sonner"; import type { RemoteControlAction, RemoteInventoryItemDto } from "@/types/localify"; @@ -15,6 +15,7 @@ import { ExternalLinkIcon, PlayIcon, RefreshIcon, + SpinnerIcon, TerminalIcon, XIcon, } from "@/components/icons"; @@ -26,20 +27,18 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; +import { Popover, PopoverContent } from "@/components/ui/popover"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { useCopyToClipboard } from "@/hooks/use-copy-to-clipboard"; import { bootstrapQueries } from "@/lib/queries"; import { tauriClient } from "@/lib/tauri-client"; -import { - ownerLabel, - remoteErrorMessage, - remoteHost, - serviceChips, - serviceTone, -} from "@/lib/util.remote"; +import { ownerLabel, remoteHost, serviceChips, serviceTone } from "@/lib/util.remote"; +import { type QuickAction, quickAction } from "@/lib/util.remote-controls"; import { cn } from "@/lib/utils"; import { remoteToneDot } from "./machine-switcher"; +import { useRemoteControls } from "./remote-controls"; +import { RemoteQuickActionCard } from "./remote-quick-action-card"; interface RemoteServiceChipProps { item: RemoteInventoryItemDto; @@ -55,8 +54,24 @@ export function RemoteServiceChip({ item, machineName, onOutput }: RemoteService const { data: bootstrap } = useQuery(bootstrapQueries.read()); const { copy, copied } = useCopyToClipboard(); const [menuOpen, setMenuOpen] = useState(false); + const controls = useRemoteControls(); + const chip = useRef