diff --git a/config.go b/config.go index 4119a0c..38a2b5b 100644 --- a/config.go +++ b/config.go @@ -53,7 +53,7 @@ var defaultConfig = &Config{ ProductId: "0x0104", //Multifunction Composite Gadget SerialNumber: "", Manufacturer: "JetKVM", - Product: "JetKVM USB Emulation Device", + Product: "USB Emulation Device", }, } diff --git a/jsonrpc.go b/jsonrpc.go index a07d461..9d10cb4 100644 --- a/jsonrpc.go +++ b/jsonrpc.go @@ -780,6 +780,10 @@ func rpcResetCloudUrl() error { return nil } +func rpcGetDefaultCloudUrl() (string, error) { + return defaultConfig.CloudURL, nil +} + var rpcHandlers = map[string]RPCHandler{ "ping": {Func: rpcPing}, "getDeviceID": {Func: rpcGetDeviceID}, @@ -841,4 +845,5 @@ var rpcHandlers = map[string]RPCHandler{ "setCloudUrl": {Func: rpcSetCloudUrl, Params: []string{"url"}}, "getCloudUrl": {Func: rpcGetCloudUrl}, "resetCloudUrl": {Func: rpcResetCloudUrl}, + "getDefaultCloudUrl": {Func: rpcGetDefaultCloudUrl}, } diff --git a/ui/.env.device b/ui/.env.device index 252fac4..c8d7c4f 100644 --- a/ui/.env.device +++ b/ui/.env.device @@ -1,2 +1,2 @@ # Used in settings page to know where to link to when user wants to adopt a device to the cloud -VITE_CLOUD_APP=http://localhost:5173 +VITE_CLOUD_APP=http://app.jetkvm.com diff --git a/ui/package-lock.json b/ui/package-lock.json index 0ba5323..dd34a03 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -22,6 +22,7 @@ "framer-motion": "^11.15.0", "lodash.throttle": "^4.1.1", "mini-svg-data-uri": "^1.4.4", + "motion": "^12.4.7", "react": "^18.2.0", "react-animate-height": "^3.2.3", "react-dom": "^18.2.0", @@ -4245,6 +4246,31 @@ "node": ">=16 || 14 >=14.17" } }, + "node_modules/motion": { + "version": "12.4.7", + "resolved": "https://registry.npmjs.org/motion/-/motion-12.4.7.tgz", + "integrity": "sha512-mhegHAbf1r80fr+ytC6OkjKvIUegRNXKLWNPrCN2+GnixlNSPwT03FtKqp9oDny1kNcLWZvwbmEr+JqVryFrcg==", + "dependencies": { + "framer-motion": "^12.4.7", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, "node_modules/motion-dom": { "version": "11.14.3", "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-11.14.3.tgz", @@ -4255,6 +4281,45 @@ "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-11.14.3.tgz", "integrity": "sha512-Xg+8xnqIJTpr0L/cidfTTBFkvRw26ZtGGuIhA94J9PQ2p4mEa06Xx7QVYZH0BP+EpMSaDlu+q0I0mmvwADPsaQ==" }, + "node_modules/motion/node_modules/framer-motion": { + "version": "12.4.7", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.4.7.tgz", + "integrity": "sha512-VhrcbtcAMXfxlrjeHPpWVu2+mkcoR31e02aNSR7OUS/hZAciKa8q6o3YN2mA1h+jjscRsSyKvX6E1CiY/7OLMw==", + "dependencies": { + "motion-dom": "^12.4.5", + "motion-utils": "^12.0.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "@emotion/is-prop-valid": "*", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@emotion/is-prop-valid": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/motion/node_modules/motion-dom": { + "version": "12.4.5", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.4.5.tgz", + "integrity": "sha512-Q2xmhuyYug1CGTo0jdsL05EQ4RhIYXlggFS/yPhQQRNzbrhjKQ1tbjThx5Plv68aX31LsUQRq4uIkuDxdO5vRQ==", + "dependencies": { + "motion-utils": "^12.0.0" + } + }, + "node_modules/motion/node_modules/motion-utils": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/motion-utils/-/motion-utils-12.0.0.tgz", + "integrity": "sha512-MNFiBKbbqnmvOjkPyOKgHUp3Q6oiokLkI1bEwm5QA28cxMZrv0CbbBGDNmhF6DIXsi1pCQBSs0dX8xjeER1tmA==" + }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", diff --git a/ui/package.json b/ui/package.json index 54f9c08..5be3e2c 100644 --- a/ui/package.json +++ b/ui/package.json @@ -31,6 +31,7 @@ "framer-motion": "^11.15.0", "lodash.throttle": "^4.1.1", "mini-svg-data-uri": "^1.4.4", + "motion": "^12.4.7", "react": "^18.2.0", "react-animate-height": "^3.2.3", "react-dom": "^18.2.0", diff --git a/ui/src/components/ActionBar.tsx b/ui/src/components/ActionBar.tsx index 6558a55..0a21dae 100644 --- a/ui/src/components/ActionBar.tsx +++ b/ui/src/components/ActionBar.tsx @@ -17,12 +17,14 @@ import MountPopopover from "./popovers/MountPopover"; import { Fragment, useCallback, useRef } from "react"; import { CommandLineIcon } from "@heroicons/react/20/solid"; import ExtensionPopover from "./popovers/ExtensionPopover"; +import { useDeviceUiNavigation } from "../hooks/useAppNavigation"; export default function Actionbar({ requestFullscreen, }: { requestFullscreen: () => Promise; }) { + const { navigateTo } = useDeviceUiNavigation(); const virtualKeyboard = useHidStore(state => state.isVirtualKeyboardEnabled); const setVirtualKeyboard = useHidStore(state => state.setVirtualKeyboardEnabled); @@ -260,15 +262,16 @@ export default function Actionbar({ /> -
+
+
+
+
Logged in as
+
+ {userEmail} +
+ )} +
+ +
+ +
+
- - - +
+ + ) : null} diff --git a/ui/src/components/Modal.tsx b/ui/src/components/Modal.tsx index 886469d..49fb0c3 100644 --- a/ui/src/components/Modal.tsx +++ b/ui/src/components/Modal.tsx @@ -2,7 +2,7 @@ import React from "react"; import { Dialog, DialogBackdrop, DialogPanel } from "@headlessui/react"; import { cx } from "@/cva.config"; -export default function Modal({ +const Modal = React.memo(function Modal({ children, className, open, @@ -17,22 +17,25 @@ export default function Modal({ -
-
+ {/* TODO: This doesn't work well with other-sessions */} +
-
+
-
e.stopPropagation()}> +
e.stopPropagation()} + > {children}
@@ -42,4 +45,6 @@ export default function Modal({
); -} +}); + +export default Modal; diff --git a/ui/src/components/SelectMenuBasic.tsx b/ui/src/components/SelectMenuBasic.tsx index eb4c540..b68bc38 100644 --- a/ui/src/components/SelectMenuBasic.tsx +++ b/ui/src/components/SelectMenuBasic.tsx @@ -19,7 +19,7 @@ type SelectMenuProps = Pick< direction?: "vertical" | "horizontal"; error?: string; fullWidth?: boolean; -} & React.ComponentProps; +} & Partial>; const sizes = { XS: "h-[24.5px] pl-3 pr-8 text-xs", @@ -60,7 +60,7 @@ export const SelectMenuBasic = React.forwardRef {label && } - +