Commit Graph

85 Commits

Author SHA1 Message Date
Alex Goodkind 718b343713
feat: add local web server loopback mode configuration ()
* feat: add local web server loopback mode configuration

- Introduced a new configuration option `LocalWebServerLoopbackOnly` to restrict the web server to listen only on the loopback interface.
- Added RPC methods `rpcGetLocalWebServerLoopbackOnly` and `rpcSetLocalWebServerLoopbackOnly` for retrieving and updating this setting.
- Updated the web server startup logic to bind to the appropriate address based on the new configuration.
- Modified the `LocalDevice` struct to include the loopback setting in the response.

* remove extra logs

* chore: add VSCode extensions for improved development environment

* refactor: rename LocalWebServerLoopbackOnly to LocalLoopbackOnly

- Updated the configuration struct and related RPC methods to use the new name `LocalLoopbackOnly` for clarity.
- Adjusted the web server binding logic and device response structure to reflect this change.

* feat: add loopback-only mode functionality to UI

- Implemented a new setting for enabling loopback-only mode, restricting web interface access to localhost.
- Added a confirmation dialog to warn users before enabling this feature.
- Updated the ConfirmDialog component to accept React nodes for the description prop.
- Refactored imports and adjusted component structure for clarity.

* refactor: optimize device settings handlers for better performance

- Refactored the `handleDevChannelChange` and `handleLoopbackOnlyModeChange` functions to use `useCallback` for improved performance and to prevent unnecessary re-renders.
- Consolidated the logic for applying loopback-only mode into a separate `applyLoopbackOnlyMode` function, enhancing code clarity and maintainability.
- Updated the confirmation flow for enabling loopback-only mode to ensure user warnings are displayed appropriately.
2025-05-27 17:28:51 +02:00
Marc Brooks 1f7c5c94d8
feat(ui): Add Ctrl+Alt+Del to the action bar ()
Since this is the sort of thing we do all the time, make it one-click away
2025-05-25 14:19:42 +02:00
Marc Brooks 55d7f22c47
chore(ui): Removed unused DeviceSettingState ()
Now that we don't do any mouse/trackpad sensitivity settings, this whole interface is unused.
2025-05-25 14:19:31 +02:00
ariedel87 2ec061b3a8
feat(Keyboard): Hide Pressed Keys () 2025-05-25 11:09:48 +02:00
Marc Brooks 1b5062c504
fix(ui): Default the keyboardLayout to en-US if not set ()
The recent fix to PasteModal will silently fail a paste if the keyboardLayout hasn't been selected in the settings yet, then when you look in Settings it looks like it's set to Belgian, but it's really just blank. Set it to default to en-US in both these places so it works like it did previously.

Fixes 
2025-05-23 13:21:53 +02:00
Aveline c1d771cced
feat: allow user to disable keyboard LED synchronization ()
* feat: allow user to disable keyboard LED synchronization

* Update ui/src/hooks/stores.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-23 00:59:02 +02:00
adammkelly 019934d33e
chore(ui): Allow mac address copying () () 2025-05-23 00:56:50 +02:00
Aveline 0c5c69f2d3
feat: sync keyboard led status () 2025-05-23 00:12:18 +02:00
Siyuan Miao 2272247668 chore: fix linter issues 2025-05-22 11:16:30 +02:00
Aveline 21e30c60ea
fix: display scaling broken () 2025-05-22 11:01:28 +02:00
Daniel Lorch b91a995918
feat(ui): enable multiple keyboard layouts for "paste text" to remote host ()
* Enable multiple keyboard layouts for paste text from host

* Trema is the more robust method for capital umlauts

* Improve error handling and pre-loading

* Improve accent handling

* Remove obscure Alt-Gr keys, unsure if they are supported everywhere

* Add Swiss French

* Change line ordering

* Fix whitespace

* Add French (France)

* Add English (UK)

* Add Swedish

* Add Spanish

* Fix fr_FR special characters

* Add more keys to Spanish

* Remove default value shift: false

* Add Norwegian

* Operator precedence 🤦

* Add Italian

* Add Czech

* Move guard statements outside of loop

* Move language name definitions into the keyboard layout files

* Change the locale names to their native language

German->Deutsch et. al.

* Move hold key handling into Go backend analogous to https://www.kernel.org/doc/Documentation/usb/gadget_hid.txt

* Remove trailing whitespace

* Fix

* Add Belgisch Nederlands

* Add JSONRPC handling

* Use useSettingsStore

* Revert "Move hold key handling into Go backend analogous to https://www.kernel.org/doc/Documentation/usb/gadget_hid.txt"

This reverts commit 146cee9309.

* Move FeatureFlag to navigation

* Fix: flip Y/Z

* Add useEffect dependencies

* Embolden language

* Add to useCallback dependencies

---------

Co-authored-by: Marc Brooks <IDisposable@gmail.com>
2025-05-21 17:40:48 +02:00
Adam Shiervani 8eaa86ae45
style(ui): update styling for access and network settings components ()
* style(ui): update styling for access and network settings components

* fix(ui): simplify conditional rendering in network settings component
2025-05-20 20:26:24 +02:00
Adam Shiervani 222a8470a5
refactor: network settings UI ()
* feat(ui): update prettier configuration and quote styles

- Add cx to tailwind functions
- Set tailwind stylesheet path
- Convert single quotes to double quotes in CSS
- Add prettier ignore comments for animation utilities

* refactor(ui): extract network information into separate components

- Create DhcpLeaseCard component
- Create Ipv6NetworkCard component

* style(ui): refine component styling and layout

- Add padding to AutoHeight component
- Improve lifetime label display format
- Enhance network information card layouts

* style(ui): enhance checkbox and radio button styling

- Update Checkbox component to use form-checkbox class
- Refactor radio button classes for consistency across components

* style(ui): Add opacity for fade-in animations

* refactor(ui): enhance Modal and network settings components

- Add stable scrollbar gutter to Modal component
- Refactor custom domain input handling and layout adjustments
2025-05-20 15:22:08 +02:00
Aveline 860327bfcd
chore: always return local version if update check fails () 2025-05-20 14:57:57 +02:00
Adam Shiervani 3f320e50f7
refactor: remove scroll sensitivity functionality and clean up related code ()
- Removed scroll sensitivity state and associated functions from jsonrpc.go and WebRTCVideo component.
- Cleaned up device settings store by eliminating unused scroll sensitivity logic.
- Updated mouse settings route to reflect the removal of scroll sensitivity feature.
- Simplified mouse wheel event handling in WebRTCVideo component.
2025-05-19 22:44:53 +02:00
rmschooley 0a4a1af80e
Improve/Simplify Mouse Wheel Scroll Behavior ()
* Improve/Simplify Mouse Wheel Scroll Behavior

* Update hid_mouse_absolute.go

Attempt to fix line reported as improperly formatted by lint.

* Update utils.go

Removed abs() function since lint states it is no longer used.
2025-05-19 13:03:33 +02:00
Marc Brooks 3ec1bdf388
chore(ui): Patch-bump packages and use tailwind upgrade ()
* chore(ui): Patch bump in tailwind related packages and framer-motion

tailwind: [4.1.6 -> 4.1.7](https://github.com/tailwindlabs/tailwindcss/compare/v4.1.6...v4.1.7)
@tailwindcss/postcss: 4.1.6 -> 4.1.7
@tailwindcss/vite: 4.1.6 -> 4.1.7

Also patch-bump of:
framer-motion: [12.11.0 -> 12.11.4](https://github.com/motiondivision/motion/compare/v12.11.0...v12.11.4)

No source changes seemingly needed, have not rerun the migrate.

* chore(ui): Run tailwind upgrade and review changes

Ran the `npx @tailwindcss/upgrade` and accepted the changes that seemed safe.

They're things like:
- `data-[closed]:translate-y-9` -> `data-closed:translate-y-8` ()swaps the square bracket syntax to a `-` modifier)
- `bg-gradient-to-*` -> `bg-linear-to-*`
- `/[*%]` -> `/*` (swap square bracket syntax for inline)
- `theme(*.*)` -> `var(--*-*)` (theme styles are exposed as variables with hyphens for dots now)
- `[background-size:*]` -> `bg-size[*]` (move the square brackets inside tag)
- `[.active_&]:` -> `in[.active]:` (new syntax for parent query)
- `!class` -> `class!` (e.g. _!overflow-visible_ to _overflow-visible!_, for [important flag](https://tailwindcss.com/docs/styling-with-utility-classes#using-the-important-flag style)
- `w-[1px]` -> `w-px` (that's a new syntax for a 1px width)
- `h-[1px]` -> `h-px` (that's a new syntax for a 1px height)
- moved `html` and `html, body` global settings in the _index.css_

Also killed off an unused `import` and blank css class.
Also picked up the two `flex-grow` -> `grow` that I missed last pass, oops.
2025-05-16 19:59:57 +02:00
Marc Brooks d54568642b
fix(ui): Fix regression on Shift-Backspace not being handled ()
This keystroke is valid and means "delete to the right" on MacOS.
2025-05-16 12:38:56 +02:00
Adam Shiervani 033bdcd645
fix(ui): Adjust EmptyCard icon size and tweak SettingsMacros () 2025-05-15 17:31:20 +02:00
Adam Shiervani baf85dcbec
refactor: Migrate from tailwind.js config to Tailwind CSS config ()
* refactor: Migrate from tailwind.js config to Tailwind CSS configuration and improve component styling

- Removed extensive theme and animation configurations from tailwind.config.js, migrating them to index.css for better organization.
- Updated components to utilize CSS variables for grid layouts and animations, enhancing maintainability.
- Adjusted various components to reflect the new CSS structure, ensuring consistent styling across the application.
- Improved accessibility and responsiveness in several UI components, including headers and popovers.
- Fixed minor styling issues and optimized class usage for better performance.

* style: use default tailwindcss/forms options

* refactor(Header): remove unused LuUser icon import
2025-05-15 17:13:16 +02:00
Marc Brooks c9dd3cd926
feat(ui): Enhance Virtual Keyboard for US ()
* feat(ui): Add Ctrl+Alt-Backspace combination key to Virtual Keyboard

Fixes  (somewhat)

* fix(ui): Correct virtual keyboard display when shift key is down.

Somewhere along the way, the handling of the shift-key state for letters and numbers was lost and we stopped displaying the capital/symbol for the key.
Also update page up and page down to have the space in the on-screen key.

* feat(ui): Add missing keys for virtual keyboard

Enable insert, delete, numpad equal, print scree, scroll lock, pause, system request, break keys.
2025-05-15 17:05:53 +02:00
Marc Brooks 7ccb8e617c
chore: Upgrade UI vite and tailwind packages ()
* chore: Upgrade UI vite and tailwind packages

Vite 5.2.0 -> 6.3.5
@vitejs/plugin-basic-ssl 1.2.0 -> 2.0.0
cva: 1.0.0-beta.1 -> 1.0.0-beta.3
focus-trap-react 10.2.3 -> 11.0.3
framer-motion 11.15.0 -> 12.11.0
@tailwindcss/postcss 4.1.6
@tailwindcss/vite 4.1.6
tailwind 3.4.17 -> 4.1.6
tailwind-merge 2.5.5 -> 3.3.0

Minor updates:
@headlessui/react 2.2.2 -> 2.2.3
@types/react 19.1.3 -> 19.1.4
@types/react-dom 19.1.3 -> 19.1.5
@typescript-eslint/eslint-plugin 8.32.0 -> 8.32.1
@typescript-eslint/parser 8.32.0 -> 8.32.1
react-simple-keyboard 3.8.71 -> 3.8.72

The new version of vite required an Node 22.15 (since that's current LTS and node 21.x is EOL)

The changes to css due to the tailwind 3 to 4 upgrade were done following [the upgrade guide](https://tailwindcss.com/docs/upgrade-guide#changes-from-v3)

Done in this order (important):
`shadow-sm` -> `shadow-xs`
`shadow` -> `shadown-sm`
`rounded` -> `rounded-sm`
`outline-none` -> `outline-hidden`
`32rem_32rem_at_center` -> `center_at_32rem_32rem` (revised order of gradient props)
`ring-1 ring-black ring-opacity-5` -> `ring-1 ring-black/50`
`flex-shrink-0` -> `shrink-0`
`flex-grow-0` -> `grow-0`
`outline outline-1` -> `outline-1`

ALSO removed the **extra** `opacity-0` on the video element (trips up latest tailwind causing the video to be invisible)

FocusTrap is now not exported as the default, so change those imports

headlessui's Menu completely changed, so upgrade to the new syntax which necessitated a reorganization of the Header.tsx to enable the "menu" to still work

* Update eslint config and fix errors
2025-05-15 14:21:03 +02:00
Adam Shiervani 340babac24
feat(network): enhance network settings UI ()
* feat(network): enhance network settings UI with domain management and improved layout

- Added custom domain input and selection options for DHCP and local domains.
- Improved layout for displaying network settings, including DHCP lease information and IPv6 addresses.
- Refactored state management for network settings and added handlers for hostname and domain changes.
- Updated the display of network settings to enhance user experience and accessibility.

* Re-add save button

* fix: add ConfirmDialog for renewing DHCP lease and improve network settings layout

- Integrated ConfirmDialog component to confirm DHCP lease renewal.
- Enhanced the layout of network settings, including better organization of IPv4 and IPv6 information.
- Updated state management for displaying network settings and lease information.
- Improved user experience with clearer descriptions and structured UI elements.

* Fix lint errors

* fix: useRef TS2554

---------

Co-authored-by: Siyuan Miao <i@xswan.net>
2025-05-14 17:25:56 +02:00
Aveline 63c2272c45
feat(usb_mass_storage): mount as disk ()
* feat(usb_mass_storage): mount as disk

* chore: try to set initial virtual media state from sysfs

* chore(usb-mass-storage): fix inquiry_string
2025-05-12 19:07:27 +02:00
Marc Brooks 8ee0532f0e
Update npm packages for the UI ()
Upgraded most packages to current as of 2025-05-09 for almost everything.
Remove the erroneous extra dependency to old xterm package since the correct @xterm/xterm package was already included (suspect a bad merge) and it was causing issues with react 19.1.
Switched to using the hooks exposed in the usehooks-ts package (this package was already referenced, suspect a bad merge) removing our private copies of useInterval, useIsMounted, useResizeObserver which are identical.
Added import of JSX from react now needed because NPX is not in global scope in react 19.x.
Explicitly cast the ref of included elements due to change in react 19.x
2025-05-12 19:00:49 +02:00
Daniel Lorch d0faf03239
Fix: Alt Gr not recognized ()
* Fix: Alt-Gr not recognized

* Proper fix for Alt-Gr not being recognized

* Add comment on codes and modifiers

* Add comment on paste box

* Remove comment

* Improve description

* Wording...

* Formatting...

* Improve description again
2025-05-12 18:59:32 +02:00
Peder Toftegaard Olsen 5a4f1766b7
feat: UI for changing display orientation
* Added UI for changing display orientation.

* Fixed lint issue.
2025-05-11 17:17:41 +02:00
Aveline 189b84380b
network enhanecment / refactor ()
* chore(network): improve connectivity check

* refactor(network): rewrite network and timesync component

* feat(display): show cloud connection status

* chore: change logging verbosity

* chore(websecure): update log message

* fix(ota): validate root certificate when downloading update

* feat(ui): add network settings tab

* fix(display): cloud connecting animation

* fix: golintci issues

* feat: add network settings tab

* feat(timesync): query servers in parallel

* refactor(network): move to internal/network package

* feat(timesync): add metrics

* refactor(log): move log to internal/logging package

* refactor(mdms): move mdns to internal/mdns package

* feat(developer): add pprof endpoint

* feat(logging): add a simple logging streaming endpoint

* fix(mdns): do not start mdns until network is up

* feat(network): allow users to update network settings from ui

* fix(network): handle errors when net.IPAddr is nil

* fix(mdns): scopedLogger SIGSEGV

* fix(dhcp): watch directory instead of file to catch fsnotify.Create event

* refactor(nbd): move platform-specific code to different files

* refactor(native): move platform-specific code to different files

* chore: fix linter issues

* chore(dev_deploy): allow to override PION_LOG_TRACE
2025-04-16 01:39:23 +02:00
Aveline 2b2a14204d
feat: implement pointer-lock and keyboard-lock ()
* feat: implement pointer-lock and keyboard-lock

* feat: Add Pointer lock functionality and SSL support in dev mode

- Introduced @vitejs/plugin-basic-ssl for enabling SSL in development.
- Added a new script `dev:ssl` to run the development server with SSL.
- Implemented pointer lock feature in the WebRTCVideo component, enhancing user interaction.
- Added a PointerLockBar component to guide users on enabling mouse control.
- Cleaned up the VideoOverlay and WebRTCVideo components for better readability and functionality.

---------

Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com>
2025-04-16 01:34:53 +02:00
Simão Gomes Viana 440f85f091
VideoOverlay: add missing word to adapter line ()
THe sentence was incomplete without "ensure".
2025-04-16 00:28:52 +02:00
Siyuan Miao 82c018a2f6 feat(tls): 2025-04-11 00:43:58 +02:00
Andrew Davis 8f6e64fd9c Add keyboard macros ()
* add jsonrpc keyboard macro get/set

* add ui keyboard macros settings and macro bar

* use notifications component and handle jsonrpc errors

* cleanup settings menu

* return error rather than truncate steps in validation

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* feat(ui): add className prop to Checkbox component to allow custom styling

* use existing components and CTA

* extract display key mappings

* create generic combobox component

* remove macro description

* cleanup styles and macro list

* create sortable list component

* split up macro routes

* remove sortable list and simplify

* cleanup macrobar

* use and add info to fieldlabel

* add useCallback optimizations

* add confirm dialog component

* cleanup delete buttons

* revert info on field label

* cleanup combobox focus

* cleanup icons

* set default label for delay

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-11 00:43:46 +02:00
Adam Shiervani 9c758b6d57 fix(ui): adjust layout and z-index for improved UI consistency in KvmIdRoute () 2025-04-11 00:43:46 +02:00
Adam Shiervani 647250c32b fix(ui): update WebRTCVideo component to properly animate on peer connection state () 2025-04-11 00:43:46 +02:00
Ben Kochie 3f20c23ea1 fix: Shell linting ()
Cleanup various shell linting issues
* Use `/usr/bin/env` consistently for better platform compatibility.
* SC2317 (info): Command appears to be unreachable.
* SC2002 (style): Useless cat.

Signed-off-by: SuperQ <superq@gmail.com>
2025-04-11 00:43:45 +02:00
Adam Shiervani b94de38510 fix(ui): increase z-index for Modal component to improve layering () 2025-04-11 00:43:45 +02:00
Adam Shiervani 1505ca1bc1 fix(dev_device): update JETKVM_PROXY_URL to use WebSocket protocol () 2025-04-11 00:43:45 +02:00
Adam Shiervani 960ef230ba Don't block new PC if connection is stable. No need to () 2025-04-11 00:43:45 +02:00
Adam Shiervani 1a30977085
Feat/Trickle ice ()
* feat(cloud): Use Websocket signaling in cloud mode

* refactor: Enhance WebRTC signaling and connection handling

* refactor: Improve WebRTC connection management and logging in KvmIdRoute

* refactor: Update PeerConnectionDisconnectedOverlay to use Card component for better UI structure

* refactor: Standardize metric naming and improve websocket logging

* refactor: Rename WebRTC signaling functions and update deployment script for debug version

* fix: Handle error when writing new ICE candidate to WebRTC signaling channel

* refactor: Rename signaling handler function for clarity

* refactor: Remove old http local http endpoint

* refactor: Improve metric help text and standardize comparison operator in KvmIdRoute

* chore(websocket): use MetricVec instead of Metric to store metrics

* fix conflicts

* fix: use wss when the page is served over https

* feat: Add app version header and update WebRTC signaling endpoint

* fix: Handle error when writing device metadata to WebRTC signaling channel

---------

Co-authored-by: Siyuan Miao <i@xswan.net>
2025-04-09 00:10:38 +02:00
Adam Shiervani 8268b20f32
refactor: Update WebRTC connection handling and overlays ()
* refactor: Update WebRTC connection handling and overlays

* fix: Update comments for WebRTC connection handling in KvmIdRoute

* chore: Clean up import statements in devices.$id.tsx
2025-04-03 19:32:14 +02:00
Adam Shiervani a3580b5465
Improve error handling when `RTCPeerConnection` throws ()
* fix(WebRTC): improve error handling during peer connection creation and add connection error overlay

* refactor: update peer connection state handling and improve type definitions across components
2025-03-25 14:54:04 +01:00
Adam Shiervani 3b711db781
Apply and Upgrade Eslint ()
* Upgrade ESLINT and fix issues

* feat: add frontend linting job to GitHub Actions workflow

* Move UI linting to separate file

* More linting fixes

* Remove pull_request trigger from UI linting workflow

* Update UI linting workflow

* Rename frontend-lint workflow to ui-lint for clarity
2025-03-25 11:56:24 +01:00
Adam Shiervani 9d511d7f58
Autoplay permission handling ()
* feat(WebRTC): enhance connection management with connection failures after X attempts or a certain time

* refactor(WebRTC): simplify WebRTCVideo component and enhance connection error handling

* fix(WebRTC): extend connection timeout from 1 second to 60 seconds for improved error handling

* feat(VideoOverlay): add NoAutoplayPermissionsOverlay component and improve HDMIErrorOverlay content

* feat(VideoOverlay): update NoAutoplayPermissionsOverlay styling and improve user instructions

* Remove unused PlayIcon import to clean up code
2025-03-24 23:32:13 +01:00
Adam Shiervani 5d7d4db4aa
Improve connection error handling ()
* feat(WebRTC): enhance connection management with connection failures after X attempts or a certain time

* refactor(WebRTC): simplify WebRTCVideo component and enhance connection error handling

* fix(WebRTC): extend connection timeout from 1 second to 60 seconds for improved error handling
2025-03-24 23:31:23 +01:00
Adam Shiervani 204e6c7faf feat(UsbDeviceSetting): integrate remote virtual media state management and improve USB config handlingt 2025-03-24 12:32:12 +01:00
Adam Shiervani caf3922ecd
refactor(WebRTCVideo): improve mouse event handling and video playback logic () 2025-03-24 12:07:31 +01:00
Adam Shiervani f198df816c
fix(Dialog): restore navigation after mount process completion () 2025-03-19 18:18:51 +01:00
Adam Shiervani f30eb0355e
fix(Dialog): ensure navigation occurs after mount process completion () 2025-03-19 18:12:49 +01:00
Adam Shiervani 8e2ed6059d
Refactor: remove USB configuration components and update settings structure () 2025-03-19 15:57:53 +01:00
Aveline d52e7d04d1
feat: relative mouse () 2025-03-19 11:47:15 +01:00