kvm/ui/src/components
Alex P 335c6ee35e refactor: centralize permissions with context provider and remove redundant code
Improvements:
- Centralized permission state management in PermissionsProvider
  - Eliminates duplicate RPC calls across components
  - Single source of truth for permission state
  - Automatic HID re-initialization on permission changes
- Split exports into separate files for React Fast Refresh compliance
  - Created types/permissions.ts for Permission enum
  - Created hooks/usePermissions.ts for the hook with safe defaults
  - Created contexts/PermissionsContext.ts for context definition
  - Updated PermissionsProvider.tsx to only export the provider component
- Removed redundant getSessionSettings RPC call (settings already in WebSocket/WebRTC messages)
- Added connectionModeChanged event handler for seamless emergency promotions
- Fixed approval dialog race condition by checking isLoadingPermissions
- Removed all redundant comments and code for leaner implementation
- Updated imports across 10+ component files

Result: Zero ESLint warnings, cleaner architecture, no duplicate RPC calls, all functionality preserved
2025-10-11 00:11:20 +03:00
..
extensions Add ability to track modifier state on the device (#725) 2025-08-26 17:09:35 +02:00
popovers fix: resolve all Go and TypeScript linting issues 2025-10-08 20:15:45 +03:00
sidebar Enhance connection stats sidebar (#748) 2025-09-08 10:59:36 +02:00
AccessDeniedOverlay.tsx fix: prevent getLocalVersion call for sessions without video permission 2025-10-08 21:42:59 +03:00
ActionBar.tsx refactor: centralize permissions with context provider and remove redundant code 2025-10-11 00:11:20 +03:00
AuthLayout.tsx Upgrade vite and react-router (#778) 2025-09-04 12:20:01 +02:00
AutoHeight.tsx refactor: network settings UI (#486) 2025-05-20 15:22:08 +02:00
Button.tsx Upgrade vite and react-router (#778) 2025-09-04 12:20:01 +02:00
Card.tsx chore(ui): Patch-bump packages and use tailwind upgrade (#456) 2025-05-16 19:59:57 +02:00
CardHeader.tsx Apply and Upgrade Eslint (#288) 2025-03-25 11:56:24 +01:00
Checkbox.tsx refactor: network settings UI (#486) 2025-05-20 15:22:08 +02:00
Combobox.tsx chore(ui): Patch-bump packages and use tailwind upgrade (#456) 2025-05-16 19:59:57 +02:00
ConfirmDialog.tsx feat: add local web server loopback mode configuration (#511) 2025-05-27 17:28:51 +02:00
Container.tsx Apply and Upgrade Eslint (#288) 2025-03-25 11:56:24 +01:00
CustomTooltip.tsx Enhance connection stats sidebar (#748) 2025-09-08 10:59:36 +02:00
DhcpLeaseCard.tsx refactor: network settings UI (#486) 2025-05-20 15:22:08 +02:00
EmptyCard.tsx fix(ui): Adjust EmptyCard icon size and tweak SettingsMacros (#452) 2025-05-15 17:31:20 +02:00
ExtLink.tsx Apply and Upgrade Eslint (#288) 2025-03-25 11:56:24 +01:00
FeatureFlag.tsx Apply and Upgrade Eslint (#288) 2025-03-25 11:56:24 +01:00
FieldLabel.tsx Added crontab scheduler for jiggler (#316) 2025-08-12 20:50:03 +02:00
Fieldset.tsx Upgrade vite and react-router (#778) 2025-09-04 12:20:01 +02:00
GridBackground.tsx refactor: Migrate from tailwind.js config to Tailwind CSS config (#451) 2025-05-15 17:13:16 +02:00
Header.tsx feat: multi-session support with role-based permissions 2025-10-08 18:52:45 +03:00
Icons.tsx Release 202412292127 2024-12-29 21:27:42 +01:00
InfoBar.tsx feat: send all paste keystrokes to backend (#789) 2025-09-18 13:00:57 +02:00
InputField.tsx Added crontab scheduler for jiggler (#316) 2025-08-12 20:50:03 +02:00
Ipv6NetworkCard.tsx feat: Adds IPv6 disabling feature (#803) 2025-09-16 12:44:56 +02:00
JigglerSetting.tsx fix: useJsonRpc "any" issue 2025-08-24 11:40:43 +02:00
KvmCard.tsx fix(ui): Don't render a button in a button (#782) 2025-09-08 11:06:08 +02:00
LoadingSpinner.tsx chore: Upgrade UI vite and tailwind packages (#443) 2025-05-15 14:21:03 +02:00
MacroBar.tsx refactor: centralize permissions with context provider and remove redundant code 2025-10-11 00:11:20 +03:00
MacroForm.tsx Add ability to track modifier state on the device (#725) 2025-08-26 17:09:35 +02:00
MacroStepCard.tsx Update UI dependencies (#819) 2025-09-24 12:16:02 +02:00
Metric.tsx Enhance connection stats sidebar (#748) 2025-09-08 10:59:36 +02:00
MetricsChart.tsx Enhance connection stats sidebar (#748) 2025-09-08 10:59:36 +02:00
Modal.tsx refactor: network settings UI (#486) 2025-05-20 15:22:08 +02:00
NicknameModal.tsx fix: resolve all Go and TypeScript linting issues 2025-10-08 20:15:45 +03:00
NotFoundPage.tsx Apply and Upgrade Eslint (#288) 2025-03-25 11:56:24 +01:00
PeerConnectionStatusCard.tsx Improve error handling when `RTCPeerConnection` throws (#289) 2025-03-25 14:54:04 +01:00
PendingApprovalOverlay.tsx feat: multi-session support with role-based permissions 2025-10-08 18:52:45 +03:00
SelectMenuBasic.tsx Added crontab scheduler for jiggler (#316) 2025-08-12 20:50:03 +02:00
SessionControlPanel.tsx refactor: centralize permissions with context provider and remove redundant code 2025-10-11 00:11:20 +03:00
SessionsList.tsx refactor: centralize permissions with context provider and remove redundant code 2025-10-11 00:11:20 +03:00
SettingsItem.tsx Fix the lazy loading for the settings page. (#837) 2025-10-01 11:43:15 +02:00
SettingsNestedSection.tsx Added crontab scheduler for jiggler (#316) 2025-08-12 20:50:03 +02:00
SettingsPageheader.tsx Move settings to modals & better modal handling (#194) 2025-02-27 16:48:50 +01:00
SettingsSectionHeader.tsx Move settings to modals & better modal handling (#194) 2025-02-27 16:48:50 +01:00
SidebarHeader.tsx Release 202412292127 2024-12-29 21:27:42 +01:00
SimpleNavbar.tsx Upgrade vite and react-router (#778) 2025-09-04 12:20:01 +02:00
StatusCards.tsx Apply and Upgrade Eslint (#288) 2025-03-25 11:56:24 +01:00
StepCounter.tsx chore(ui): Patch-bump packages and use tailwind upgrade (#456) 2025-05-16 19:59:57 +02:00
Terminal.tsx Add ability to track modifier state on the device (#725) 2025-08-26 17:09:35 +02:00
TextArea.tsx chore: Upgrade UI vite and tailwind packages (#443) 2025-05-15 14:21:03 +02:00
USBStateStatus.tsx refactor(ui): Don't fetch KeybardAndMouse Icon on every re-render (#795) 2025-09-11 19:57:35 +02:00
UnifiedSessionRequestDialog.tsx feat: improve session approval workflow with re-request and rejection limits 2025-10-08 21:37:02 +03:00
UpdateInProgressStatusCard.tsx chore(ui): Patch-bump packages and use tailwind upgrade (#456) 2025-05-16 19:59:57 +02:00
UsbDeviceSetting.tsx Fix the lazy loading for the settings page. (#837) 2025-10-01 11:43:15 +02:00
UsbInfoSetting.tsx Fix the lazy loading for the settings page. (#837) 2025-10-01 11:43:15 +02:00
VideoOverlay.tsx fix(ui): Fix full-screen keyboard lock issues. (#535) 2025-06-03 01:28:35 +02:00
VirtualKeyboard.tsx feat(ui) Fix the CapsLock and Shift key for VirtualKeyboard (#779) 2025-09-04 22:26:51 +02:00
WebRTCVideo.tsx refactor: centralize permissions with context provider and remove redundant code 2025-10-11 00:11:20 +03:00