Commit Graph

66 Commits

Author SHA1 Message Date
SuperQ 75296b4b7e
Chore: Enable golangci-lint
Add a GitHub actions workflow to run golangci-lint.

Signed-off-by: SuperQ <superq@gmail.com>
2025-03-11 18:35:12 +01:00
SuperQ d3641bb4b9
Chore: Fix up various linting issues
In prep to add golangci-lint, fix various linting issues.
* Make the `kvm` package a fully-qualified public package.

Signed-off-by: SuperQ <superq@gmail.com>
2025-03-11 18:22:45 +01:00
Aveline 4884240f5f
Cleanup logging (#216) 2025-03-11 18:18:15 +01:00
SuperQ 34e33e45bf
Cleanup logging
Make sure all logging output is called via the main logger instead of
stdlib `"log"` or `fmt.Print(f|ln)`.

Signed-off-by: SuperQ <superq@gmail.com>
2025-03-11 16:53:54 +01:00
Aveline c5cec99797
feat: usb dynamic config (#248) 2025-03-10 17:08:29 +01:00
Siyuan Miao d1948adca8 refactor(usb): move usbconfig to a seperated package 2025-03-10 14:02:52 +01:00
Siyuan Miao c088534d34 feat(usb): dynamic usb devices config 2025-03-10 13:54:42 +01:00
Simon Smith 5c7accae0d
add confirm prompt to delete file (#243) 2025-03-10 10:56:57 +01:00
Adam Shiervani 536e823243
feat: Add scroll sensitivity configuration and improved wheel event handling (#242)
- Implement scroll sensitivity settings with low, default, and high modes
- Add RPC methods for getting and setting scroll sensitivity
- Enhance wheel event handling with device-specific sensitivity and clamping
- Create a new device settings store for managing scroll and trackpad parameters
- Update mouse settings route to include scroll sensitivity selection
2025-03-10 10:51:11 +01:00
Simon Smith 3b83f4c7a1
fix rpcGetUsbEmulationState filepath (#241) 2025-03-09 15:12:27 +01:00
Carl Downing 1ec87f043f
copyedits (#232)
* fix case

* fix typos

* fix css class names

---------

Co-authored-by: Carl Downing <carl@undivided.io>
2025-03-09 15:04:11 +01:00
Aveline 554121a20b
chore: ensure config is loaded before init functions (#226) 2025-03-04 11:32:54 +01:00
Aveline d4efd72731
feat: implement build and test workflow (#224) 2025-03-03 22:33:43 +01:00
Siyuan Miao 08a315d908 feat: implement build and test workflow 2025-03-03 22:18:36 +01:00
Adam Shiervani 16f83e6136
fix(build): Add frontend build step to dev release process (#219) 2025-03-03 14:15:43 +01:00
Aveline da97a17977
fix(usb_config): check if usb_config is defined in kvm_config.json (#220) 2025-03-03 13:33:06 +01:00
Siyuan Miao a60d373849 fix(usb_config): check if usb_config is defined in kvm_config.json 2025-03-03 13:32:51 +01:00
Adam Shiervani 7e6a24800e
fix(build): Fix Buildate date (#218) 2025-03-03 11:44:36 +01:00
Adam Shiervani 7f43ba869f
fix(ui): Improve terminal data channel handling for cross-browser compatibility (#210)
- Add support for different binary data types (ArrayBuffer and Blob)
- Implement FileReader for converting Blob data in Firefox
- Send initial terminal size on data channel open
2025-02-28 14:29:08 +01:00
Adam Shiervani b499482c5d
chore(deps): Update UI dependencies to latest versions (#209) 2025-02-28 13:57:17 +01:00
Adam Shiervani e4bb4f288c
feat(cloud): Add support for custom cloud app URL configuration (#207)
* feat(cloud): Add support for custom cloud app URL configuration

- Extend CloudState and Config to include CloudAppURL
- Update RPC methods to handle both API and app URLs
- Modify cloud adoption and settings routes to support custom app URLs
- Remove hardcoded cloud app URL environment file
- Simplify cloud URL configuration in UI

* fix(cloud): Improve cloud URL configuration and adoption flow

- Update error handling in cloud URL configuration RPC method
- Modify cloud adoption route to support dynamic cloud URLs
- Remove hardcoded default cloud URLs in device access settings
- Refactor cloud adoption click handler to be more flexible

* refactor(cloud): Simplify cloud URL configuration RPC method

- Update rpcSetCloudUrl to return only an error
- Remove unnecessary boolean return value
- Improve error handling consistency

* refactor(ui): Simplify cloud provider configuration and URL handling
2025-02-28 13:48:52 +01:00
Adam Shiervani 482c64ad02
feat(ui): Add feature flag system (#208) 2025-02-28 12:49:55 +01:00
Adam Shiervani 543ef2114e
fix(ui): Navigate to root on cloud device access settings disconnection (#205) 2025-02-27 17:24:15 +01:00
Adam Shiervani a4863f6999
refactor(ui): Improve device access settings with conditional rendering and loader data handling (#204) 2025-02-27 17:18:56 +01:00
Adam Shiervani d49a567a38
refactor(ui): Extract device UI path generation to standalone function (#203) 2025-02-27 17:08:13 +01:00
Adam Shiervani a3355bb81c fix(ui): Update device route navigation to root on modal close 2025-02-27 16:59:43 +01:00
Adam Shiervani 4052b3d225
Move settings to modals & better modal handling (#194)
* feat(ui): Add other session handling route and modal

* feat(ui): Add dedicated update route and refactor update dialog state management

* feat(ui): Add local authentication route

* refactor(ui): Remove LocalAuthPasswordDialog component and clean up related code

* refactor(ui): Remove OtherSessionConnectedModal component

* feat(ui): Add dedicated mount route and refactor mount media dialog

* refactor(ui): Simplify Escape key navigation in device route

* refactor(ui): Add TODO comments for future URL-based state migration

* refactor(ui): Migrate settings and update routes to dedicated routes

This commit introduces a comprehensive refactoring of the UI routing and state management:
- Removed sidebar-based settings view
- Replaced global modal state with URL-based routing
- Added dedicated routes for settings, including general, security, and update sections
- Simplified modal and sidebar interactions
- Improved animation and transition handling using motion library
- Removed deprecated components and simplified route structure

* fix(ui): Add TODO comment for modal session interaction

* refactor(ui): Move USB configuration to new settings setup

This commit introduces several improvements to the USB configuration workflow:
- Refactored USB configuration dialog component
- Simplified USB config state management
- Moved USB configuration to hardware settings route
- Updated JSON-RPC type definitions
- Cleaned up unused imports and components
- Improved error handling and notifications

* refactor(ui): Replace react-router-dom navigation with custom navigation hook

This commit introduces a new custom navigation hook `useDeviceUiNavigation` to replace direct usage of `useNavigate` across multiple components:
- Removed direct `useNavigate` imports in various components
- Added `navigateTo` method from new navigation hook
- Updated navigation calls in ActionBar, MountPopover, UpdateInProgressStatusCard, and other routes
- Simplified navigation logic and prepared for potential future navigation enhancements
- Removed console logs and unnecessary comments

* refactor(ui): Remove unused react-router-dom import

Clean up unnecessary import of `useNavigate` from react-router-dom in device settings route

* feat(ui): Improve mobile navigation and scrolling in device settings

* refactor(ui): Reorganize device access and security settings

This commit introduces several changes to the device access and security settings:
- Renamed "Security" section to "Access" in settings navigation
- Moved local authentication routes from security to access
- Removed deprecated security settings route
- Added new route for device access settings with cloud and local authentication management
- Updated cloud URL and adoption logic to be part of the access settings
- Simplified routing and component structure for better user experience

* fix(ui): Update logout button hover state color

* fix(ui): Adjust device de-registration button size to small

* fix(ui): Update appearance settings section header and description

* refactor(ui): Replace SectionHeader with new SettingsPageHeader and SettingsSectionHeader components

This commit introduces two new header components for settings pages:
- Created SettingsPageHeader for main page headers
- Created SettingsSectionHeader for subsection headers
- Replaced all existing SectionHeader imports with new components
- Updated styling and type definitions to support more flexible header rendering

* feat(ui): Add dev channel toggle to advanced settings

Move dev channel update option from general settings to advanced settings
- Introduced new state and handler for dev channel toggle
- Removed dev channel option from general settings route
- Added dev channel toggle in advanced settings with error handling
2025-02-27 16:48:50 +01:00
jackislanding 77263e73f7
Feature/usb config - Rebasing USB Config Changes on Dev Branch (#185)
* rebasing on dev branch

* fixed formatting

* fixed formatting

* removed query params

* moved usb settings to hardware setting

* swapped from error to log

* added fix for any change to product name now resulting in show the spinner as custom on page reload

* formatting

---------

Co-authored-by: JackTheRooster <adrian@rydeas.com>
Co-authored-by: Adam Shiervani <adam.shiervani@gmail.com>
2025-02-27 09:53:47 +01:00
Adam Shiervani 92aec30c8f
fix(ui): Fix & Update Ubuntu 24.04 LTS ISO download URL to latest version (#197) 2025-02-26 11:57:03 +01:00
Aveline ba0c937e2a
feat: prometheus metrics endpoint 2025-02-25 16:19:32 +01:00
Adam Shiervani f4a86a2d11
feat(dev): Add option to skip frontend build in dev_deploy.sh (#183) 2025-02-25 16:12:04 +01:00
Adam Shiervani 7304e6b672
feat(cloud): Add custom cloud API URL configuration support (#181)
* feat(cloud): Add custom cloud API URL configuration support

- Implement RPC methods to set, get, and reset cloud URL
- Update cloud registration to remove hardcoded cloud API URL
- Modify UI to allow configuring custom cloud API URL in developer settings
- Remove environment-specific cloud configuration files
- Simplify cloud URL configuration in UI config

* fix(ui): Update cloud app URL to production environment in device mode

* refactor(ui): Remove SIGNAL_API env & Rename to DEVICE_API to make clear distinction between  CLOUD_API and DEVICE_API.

* feat(ui): Only show Cloud API URL Change on device mode

* fix(cloud): Don't override the CloudURL on deregistration from the cloud.
2025-02-25 16:10:46 +01:00
SuperQ e1ea783fc7
Feature: Add a metrics endpoint
Add a basic Prometheus Monitoring metrics endpoint.
* Include a `jetkvm_build_info` metric.
* `go mod tidy`

Signed-off-by: SuperQ <superq@gmail.com>
2025-02-23 15:18:46 +01:00
Techno Tim de5403eada
fix(devcontainer): Map local ssh keys to container (#180) 2025-02-20 21:39:25 +01:00
Siyuan Miao ff3727b1fe chore: bump version to 0.3.7 2025-02-19 14:03:18 +01:00
Adam Shiervani d415afcea9
feat(ui): improve video playback and keyboard handling in WebRTCVideo (#176)
* feat(ui): improve video playback and keyboard handling in WebRTCVideo

* fix(ui): correct event handler naming in WebRTCVideo component
2025-02-19 14:00:15 +01:00
Adam Shiervani 368c1eea90
refactor(ui): simplify backlight settings handling (#175) 2025-02-19 11:38:11 +01:00
Aveline b38f899c84
fix(config): should return defaultConfig when config file doesnt exist (#174) 2025-02-19 10:27:24 +01:00
Siyuan Miao a3d21557c3 fix(config): should return defaultConfig when config file doesnt exist 2025-02-19 10:25:45 +01:00
Adam Shiervani 5e91cfc7fa
Add full dark mode support to FieldLabel component (#173) 2025-02-18 19:30:04 +01:00
Adam Shiervani 9ffdf0c4a6
feat(dev): use npx and update dev_device.sh to accept IP address as a command-line argument (#169) 2025-02-18 17:22:35 +01:00
Aveline 591d512b11
add extra logging and tune timeout settings for cloud (#167)
* chore(config): merge userConfig with defaultConfig and add a lock

* chore(cloud): add extra logging and tune timeout settings
2025-02-18 17:22:03 +01:00
Aveline 69461140e3
chore(config): merge userConfig with defaultConfig and add a lock (#164)
* chore(config): merge userConfig with defaultConfig and add a lock

* chore(config): remove lock for LoadConfig
2025-02-17 20:12:34 +01:00
Aveline cd333c4ebc
feat(extension): ATX/DC/Serial extension support 2025-02-17 18:37:47 +01:00
Adam Shiervani 1973a65635
feat(dev): change default npm dev script to device mode and add wrapper script to set environment variable and proxy signal api (#157) 2025-02-17 16:29:42 +01:00
Aveline f3b4dbce49
feat: use the api url from device config (#161) 2025-02-17 11:34:38 +01:00
Aveline 806792203f
feat(ntp): add delay between sync attempts and support NTP servers from DHCP (#162)
* feat(ntp): use ntp server from dhcp info

* feat(ntp): use ntp server from dhcp info

* feat(ntp): add delay between time sync attempts

* chore(ntp): more logging
2025-02-17 11:02:28 +01:00
Cameron Fleming 5217377175
feat(display.go): Add display brightness settings (#17)
* feat(display.go): impl setDisplayBrightness()

Implements setDisplayBrightness(brightness int) which allows setting the
backlight brightness on JetKVM's hardware.

Needs to be implemented into the RPC, config and frontend.

* feat(config): add backlight control settings

* feat(display): add automatic dimming & switch off to display

WIP, dims the display to 50% of the BacklightMaxBrightness after
BacklightDimAfterMS expires. Turns the display off after
BacklightOffAfterMS

* feat(rpc): add methods to get and set BacklightSettings

* WIP: feat(settings): add Max backlight setting

* chore: use constant for backlight control file

* fix: only attempt to wake the display if it's off

* feat(display): wake on touch

* fix: re-use buffer between reads

* fix: wakeDisplay() on start to fix warm start issue

If the application had turned off the display before exiting, it
wouldn't be brought on when the application restarted without a device
reboot.

* chore: various comment & string updates

* fix: newline on set brightness log

Noticed by @eric
https://github.com/jetkvm/kvm/pull/17#discussion_r1903338705

* fix: set default value for display

Set the DisplayMaxBrightness to the default brightness used
out-of-the-box by JetKVM. Also sets the dim/timeout to 2 minutes and 30
mintes respectively.

* feat(display.go): use tickers to countdown to dim/off

As suggested by tutman in https://github.com/jetkvm/kvm/pull/17, use
tickers set to the duration of dim/off to avoid a loop running every
second. The tickers are reset to the dim/off times whenever
wakeDisplay() is called.

* chore: update config

Changed Dim & Off values to seconds instead of milliseconds, there's no
need for it to be that precise.

* feat(display.go): wakeDisplay() force

Adds the force boolean to wakedisplay() which allows skipping the
backlightState == 0 check, this means you can force a ticker reset, even
if the display is currently in the "full bright" state

* feat(display.go): move tickers into their own method

This allows them to only be started if necessary. If the user has chosen
to keep the display on and not-dimmed all the time, the tickers can't
start as their tick value must be a positive integer.

* feat(display.go): stop tickers when auto-dim/auto-off is disabled

* feat(rpc): implement display backlight control methods

* feat(ui): implement display backlight control

* chore: update variable names

As part of @joshuasing's review on #17, updated variables & constants to
match the Go best practices.

Signed-off-by: Cameron Fleming <cameron@nevexo.space>

* fix(display): move backlightTicker setup into screen setup goroutine

Signed-off-by: Cameron Fleming <cameron@nevexo.space>

* chore: fix some start-up timing issues

* fix(display): Don't attempt to start the tickers if the display is disabled

If max_brightness is zero, then there's no point in trying to dim it (or
turn it off...)

* fix: wakeDisplay() doesn't need to stop the tickers

The tickers only need to be reset, if they're disabled, they won't have
been started.

* fix: Don't wake up the display if it's turned off

---------

Signed-off-by: Cameron Fleming <cameron@nevexo.space>
2025-02-17 11:00:28 +01:00
Andrew 951173ba19
Restart mDNS every time the connection information changes (#155) 2025-02-13 18:10:47 +01:00
Cameron Fleming 2a99c2db9d
fix(net): stop dhcp client and release all v4 addr on linkdown (#16)
This commit fixes jetkvm/kvm#12 by disabling the udhcpc client when the
link goes down, it then removes all the active IPv4 addresses from the
deivce.

Once the link comes back up, it re-activates the udhcpc client so it can
fetch a new IPv4 address for the device.

This doesn't make any changes to the IPv6 side of things yet.
2025-02-13 15:41:10 +01:00