From 35efb736fdcaca43834bc065b78f801354c7d66b Mon Sep 17 00:00:00 2001 From: Sean Edmunds Date: Tue, 30 Dec 2025 09:35:50 -0600 Subject: [PATCH] Added Guacamole Client type --- .../DebouncedGuacamoleClient.tsx | 63 ++++++++++++++++++- .../GuacamoleClients/GuacamoleClients.tsx | 60 +++++++++++++++++- src/types/guacamoleClient.ts | 1 + 3 files changed, 120 insertions(+), 4 deletions(-) diff --git a/src/pages/settings/components/GuacamoleClients/DebouncedGuacamoleClient.tsx b/src/pages/settings/components/GuacamoleClients/DebouncedGuacamoleClient.tsx index 1bf9050..0def843 100644 --- a/src/pages/settings/components/GuacamoleClients/DebouncedGuacamoleClient.tsx +++ b/src/pages/settings/components/GuacamoleClients/DebouncedGuacamoleClient.tsx @@ -1,10 +1,25 @@ -import { ActionIcon, Card, Group, Stack, Text, TextInput, Tooltip } from '@mantine/core'; +import { + ActionIcon, + Card, + Group, + Select, + Stack, + Text, + TextInput, + Tooltip, +} from '@mantine/core'; import { useDebouncedValue, useDisclosure } from '@mantine/hooks'; import { DeleteItemModal } from 'components'; import { useCommonHooks, useMutationAPI } from 'hooks'; import { useEffect, useState } from 'react'; import { FiTrash } from 'react-icons/fi'; -import { cardClasses, textClasses, textInputClasses, toolTipClasses } from 'styles'; +import { + cardClasses, + selectClasses, + textClasses, + textInputClasses, + toolTipClasses, +} from 'styles'; import type { GuacamoleClient } from 'types'; function DebouncedGuacamoleClient({ @@ -17,7 +32,7 @@ function DebouncedGuacamoleClient({ const { handleDelete, isMobile, theme } = useCommonHooks(); const [modalOpened, { open: openModal, close: closeModal }] = useDisclosure(false); const { mutateAsync } = useMutationAPI(); - + const types: string[] = ['SSH', 'RDP', 'VNC']; const [client, setClient] = useState(guacamoleClient); const [update, setUpdate] = useState({}); const [debounced] = useDebouncedValue(update, 1000); @@ -114,6 +129,48 @@ function DebouncedGuacamoleClient({ : undefined } /> + { + return { + label: type, + value: type, + }; + })} + comboboxProps={{ + zIndex: 3000, + }} + styles={ + theme.textShadowsEnabled + ? { + label: { boxShadow: '2px 2px var(--mantine-color-border-0)' }, + } + : undefined + } + renderOption={(item: ComboboxLikeRenderOptionInput) => { + return ( + + {item.option.value} + {item.option.value === 'SSH' && } + {item.option.value === 'RDP' && } + {item.option.value === 'VNC' && } + + ); + }} + searchable + maxDropdownHeight={175} + onDropdownOpen={() => setIsOpen(true)} + onDropdownClose={() => setIsOpen(false)} + withAsterisk + /> +