diff --git a/package-lock.json b/package-lock.json index 454b6c0..2f19572 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,12 +15,12 @@ "@mantine/form": "^8.3.10", "@mantine/hooks": "^8.3.10", "@mantine/notifications": "^8.3.10", - "@tanstack/react-query": "^5.90.12", - "@tanstack/react-query-devtools": "^5.91.1", - "@tanstack/react-query-persist-client": "^5.90.14", + "@tanstack/react-query": "^5.90.15", + "@tanstack/react-query-devtools": "^5.91.2", + "@tanstack/react-query-persist-client": "^5.90.17", "@tanstack/react-table": "^8.21.3", "idb-keyval": "^6.2.2", - "jotai": "^2.16.0", + "jotai": "^2.16.1", "react": "^19.2.3", "react-dom": "^19.2.3", "react-icons": "^5.5.0", @@ -1608,29 +1608,29 @@ "license": "MIT" }, "node_modules/@tanstack/query-core": { - "version": "5.90.12", - "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.12.tgz", - "integrity": "sha512-T1/8t5DhV/SisWjDnaiU2drl6ySvsHj1bHBCWNXd+/T+Hh1cf6JodyEYMd5sgwm+b/mETT4EV3H+zCVczCU5hg==", + "version": "5.90.15", + "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.90.15.tgz", + "integrity": "sha512-mInIZNUZftbERE+/Hbtswfse49uUQwch46p+27gP9DWJL927UjnaWEF2t3RMOqBcXbfMdcNkPe06VyUIAZTV1g==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/query-devtools": { - "version": "5.91.1", - "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.91.1.tgz", - "integrity": "sha512-l8bxjk6BMsCaVQH6NzQEE/bEgFy1hAs5qbgXl0xhzezlaQbPk6Mgz9BqEg2vTLPOHD8N4k+w/gdgCbEzecGyNg==", + "version": "5.92.0", + "resolved": "https://registry.npmjs.org/@tanstack/query-devtools/-/query-devtools-5.92.0.tgz", + "integrity": "sha512-N8D27KH1vEpVacvZgJL27xC6yPFUy0Zkezn5gnB3L3gRCxlDeSuiya7fKge8Y91uMTnC8aSxBQhcK6ocY7alpQ==", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" } }, "node_modules/@tanstack/query-persist-client-core": { - "version": "5.91.11", - "resolved": "https://registry.npmjs.org/@tanstack/query-persist-client-core/-/query-persist-client-core-5.91.11.tgz", - "integrity": "sha512-NNpRGxQY/nVOdzfs5QbevPjGsUVoEiFwqxxaopLyu6todwtDOCfIOfhXSmpMVXBiCxUn7kqaUB1iwaBKqoAVRQ==", + "version": "5.91.14", + "resolved": "https://registry.npmjs.org/@tanstack/query-persist-client-core/-/query-persist-client-core-5.91.14.tgz", + "integrity": "sha512-22vWKM2SXU29AUAzCv4pjKWx+mVam5QjPH+XZ1FQeH4DgO9HFPjWN8Bf9NVF2ki8eFGzTy+7FCBylEgV+LZgJw==", "dependencies": { - "@tanstack/query-core": "5.90.12" + "@tanstack/query-core": "5.90.15" }, "funding": { "type": "github", @@ -1638,11 +1638,11 @@ } }, "node_modules/@tanstack/react-query": { - "version": "5.90.12", - "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.12.tgz", - "integrity": "sha512-graRZspg7EoEaw0a8faiUASCyJrqjKPdqJ9EwuDRUF9mEYJ1YPczI9H+/agJ0mOJkPCJDk0lsz5QTrLZ/jQ2rg==", + "version": "5.90.15", + "resolved": "https://registry.npmjs.org/@tanstack/react-query/-/react-query-5.90.15.tgz", + "integrity": "sha512-uQvnDDcTOgJouNtAyrgRej+Azf0U5WDov3PXmHFUBc+t1INnAYhIlpZtCGNBLwCN41b43yO7dPNZu8xWkUFBwQ==", "dependencies": { - "@tanstack/query-core": "5.90.12" + "@tanstack/query-core": "5.90.15" }, "funding": { "type": "github", @@ -1653,34 +1653,34 @@ } }, "node_modules/@tanstack/react-query-devtools": { - "version": "5.91.1", - "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.91.1.tgz", - "integrity": "sha512-tRnJYwEbH0kAOuToy8Ew7bJw1lX3AjkkgSlf/vzb+NpnqmHPdWM+lA2DSdGQSLi1SU0PDRrrCI1vnZnci96CsQ==", + "version": "5.91.2", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-devtools/-/react-query-devtools-5.91.2.tgz", + "integrity": "sha512-ZJ1503ay5fFeEYFUdo7LMNFzZryi6B0Cacrgr2h1JRkvikK1khgIq6Nq2EcblqEdIlgB/r7XDW8f8DQ89RuUgg==", "dependencies": { - "@tanstack/query-devtools": "5.91.1" + "@tanstack/query-devtools": "5.92.0" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/react-query": "^5.90.10", + "@tanstack/react-query": "^5.90.14", "react": "^18 || ^19" } }, "node_modules/@tanstack/react-query-persist-client": { - "version": "5.90.14", - "resolved": "https://registry.npmjs.org/@tanstack/react-query-persist-client/-/react-query-persist-client-5.90.14.tgz", - "integrity": "sha512-jTGnr/DBlzV/UYqU+b8bZWECBuqh3Q3g7Ih50IktZkvmwTUsidQhhl2JyknNYVZkl5AgMfPAywNKZLTI82wmlA==", + "version": "5.90.17", + "resolved": "https://registry.npmjs.org/@tanstack/react-query-persist-client/-/react-query-persist-client-5.90.17.tgz", + "integrity": "sha512-iipmRT7CpW/Is/RKHXPDuWS0FP7RrmJL/KofNb0aKYMl5dH88R0PZ7N0PvJ44SZCwl44p4VG/4ugGDISutCgtQ==", "dependencies": { - "@tanstack/query-persist-client-core": "5.91.11" + "@tanstack/query-persist-client-core": "5.91.14" }, "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" }, "peerDependencies": { - "@tanstack/react-query": "^5.90.12", + "@tanstack/react-query": "^5.90.15", "react": "^18 || ^19" } }, @@ -2962,9 +2962,9 @@ "dev": true }, "node_modules/jotai": { - "version": "2.16.0", - "resolved": "https://registry.npmjs.org/jotai/-/jotai-2.16.0.tgz", - "integrity": "sha512-NmkwPBet0SHQ28GBfEb10sqnbVOYyn6DL4iazZgGRDUKxSWL0iqcm+IK4TqTSFC2ixGk+XX2e46Wbv364a3cKg==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/jotai/-/jotai-2.16.1.tgz", + "integrity": "sha512-vrHcAbo3P7Br37C8Bv6JshMtlKMPqqmx0DDREtTjT4nf3QChDrYdbH+4ik/9V0cXA57dK28RkJ5dctYvavcIlg==", "engines": { "node": ">=12.20.0" }, diff --git a/package.json b/package.json index 6607cd6..1d7189e 100644 --- a/package.json +++ b/package.json @@ -17,12 +17,12 @@ "@mantine/form": "^8.3.10", "@mantine/hooks": "^8.3.10", "@mantine/notifications": "^8.3.10", - "@tanstack/react-query": "^5.90.12", - "@tanstack/react-query-devtools": "^5.91.1", - "@tanstack/react-query-persist-client": "^5.90.14", + "@tanstack/react-query": "^5.90.15", + "@tanstack/react-query-devtools": "^5.91.2", + "@tanstack/react-query-persist-client": "^5.90.17", "@tanstack/react-table": "^8.21.3", "idb-keyval": "^6.2.2", - "jotai": "^2.16.0", + "jotai": "^2.16.1", "react": "^19.2.3", "react-dom": "^19.2.3", "react-icons": "^5.5.0", diff --git a/src/pages/homepage/components/Search/Search.tsx b/src/pages/homepage/components/Search/Search.tsx index 35d52ec..83256eb 100644 --- a/src/pages/homepage/components/Search/Search.tsx +++ b/src/pages/homepage/components/Search/Search.tsx @@ -27,6 +27,7 @@ import type { import RecommendedApplications from './components/RecommendedApplications'; import RecommendedBookmarks from './components/RecommendedBookmarks'; import SearchSelectItem from './components/SearchSelectItem'; +import { FaComputer } from 'react-icons/fa6'; export default function Search({ current, @@ -128,6 +129,11 @@ export default function Search({ open(validUrl, '_self'); }; + const handleGuacamoleClientLaunchItem = ({ option }: { option: any }) => { + const validUrl = `https://sean.bet/guacamole/#/client/${option.clientIdentifier}`; + open(validUrl, '_self'); + }; + const handleKeyPress = (item: any) => { let option = ''; let subtext = ''; @@ -165,12 +171,11 @@ export default function Search({ : `http://${url}`; open(validUrl, '_self'); } else if (providerLabel.startsWith('Connect to')) { - const id = guacamoleClients.find( + const client = guacamoleClients?.find( (client: GuacamoleClient) => - client.clientName.substring(1).toLowerCase() === item.target.value.substr(1), - )?.id; - - open(`https://sean.bet/guacamole/#/${id}`, '_self'); + client.clientName.toLowerCase() === item.target.value.toLowerCase().substr(1), + ); + open(`https://sean.bet/guacamole/#/client/${client?.clientIdentifier}`, '_self'); } else if (urlPattern.test(item.target.value)) { if (/^(https?:\/\/).*/i.test(item.target.value)) globalThis.location = item.target.value; @@ -300,7 +305,7 @@ export default function Search({ if ( guacamoleClients?.find( (client: GuacamoleClient) => - client.clientName.substring(1).toLowerCase() === item.target.value.substr(1), + client.clientName.toLowerCase() === item.target.value.toLowerCase().substr(1), ) ) { setProviderLabel(`Connect to ${item.target.value.substr(1)}`); @@ -375,17 +380,15 @@ export default function Search({ }; const renderItem: any = (item: any) => { - const Icon = - allIcons[ + const Icon = item.option.icon ? + (allIcons[ item.option.icon ? item.option.icon : item.option.prefix === '/g' ? 'FaGoogle' : (providers.find((p: Provider) => p.prefix === item.option.prefix)?.icon ?? '') - ]; - if ((searchValue as string).startsWith('>')) { - } + ]) : (allIcons['FaComputer']); return (searchValue as string).startsWith('!') ? ( { e.preventDefault(); e.stopPropagation(); + handleGuacamoleClientLaunchItem(item); }} > Connect to + {item.option.name || item.option.clientName || 'Invalid connection'}