From dd287c0444ec57f4aefe7b24d5d18022d26b6d39 Mon Sep 17 00:00:00 2001 From: Aarnav Tale Date: Fri, 20 Jun 2025 19:55:02 -0400 Subject: [PATCH] fix: menu should work even with ssh target --- app/routes/machines/components/menu.tsx | 124 ++++++++++++------------ 1 file changed, 60 insertions(+), 64 deletions(-) diff --git a/app/routes/machines/components/menu.tsx b/app/routes/machines/components/menu.tsx index c3acf16..4c7a9ce 100644 --- a/app/routes/machines/components/menu.tsx +++ b/app/routes/machines/components/menu.tsx @@ -1,5 +1,6 @@ import { Cog, Ellipsis, SquareTerminal } from 'lucide-react'; import { useState } from 'react'; +import Button from '~/components/Button'; import Menu from '~/components/Menu'; import type { User } from '~/types'; import cn from '~/utils/cn'; @@ -32,7 +33,7 @@ export default function MachineMenu({ node.hostInfo?.sshHostKeys && node.hostInfo?.sshHostKeys.length > 0; return ( - <> +
{modal === 'remove' && ( )} + {supportsTailscaleSSH ? ( + isFullButton ? ( + + ) : ( + + ) + ) : undefined} {isFullButton ? ( -
- {supportsTailscaleSSH ? ( - { - // We need to use JS to open the SSH URL - // in a new WINDOW since href can only - // do a new TAB. - window.open( - // TODO: Use the actual real username lol - `${__PREFIX__}/ssh?hostname=${node.name}&username=tale`, - '_blank', - 'noopener,noreferrer,width=800,height=600', - ); - }} - > - -

SSH

-
- ) : undefined} - - -

Machine Settings

-
-
+ + +

Machine Settings

+
) : ( -
- {supportsTailscaleSSH ? ( - { - // We need to use JS to open the SSH URL - // in a new WINDOW since href can only - // do a new TAB. - window.open( - // TODO: Use the actual real username lol - `${__PREFIX__}/ssh?hostname=${node.name}&username=tale`, - '_blank', - 'noopener,noreferrer,width=800,height=600', - ); - }} - className={cn( - 'py-0.5 w-fit bg-transparent border-transparent', - 'border group-hover:border-headplane-200', - 'dark:group-hover:border-headplane-700', - 'opacity-0 pointer-events-none group-hover:opacity-100', - 'group-hover:pointer-events-auto', - )} - > - SSH - - ) : undefined} - - - -
+ + + )} setModal(key as Modal)} @@ -176,6 +172,6 @@ export default function MachineMenu({
- +
); }