mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-22 16:06:19 -05:00
controller: Desktop start/stop toggle; rename hotspot/bluetooth actions to what they do
Add a Desktop toggle to the Controller (both UIs) that starts/stops display-manager.service. Fail open: the unit is never enabled/disabled, so the desktop always returns on reboot; users who want it disabled across reboots can set the default target themselves. Rename the hotspot and bluetooth actions to reflect their real behavior: - enable/disable_hotspot -> start/stop_hotspot (/api/hotspot/start|stop) - enable/disable_bluetooth -> unblock/block_bluetooth (rfkill semantics, /api/bluetooth/unblock|block) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
a4eeba14ee
commit
3e559e1bf8
14 changed files with 712 additions and 132 deletions
|
|
@ -79,6 +79,7 @@ jest.mock('../../hooks/customHooks', () => ({
|
|||
useDockerized: jest.fn().mockReturnValue(false),
|
||||
useMediaDirectory: jest.fn().mockReturnValue('/media/wrolpi'),
|
||||
useBluetooth: jest.fn().mockReturnValue({on: false, setBluetooth: jest.fn()}),
|
||||
useDesktop: jest.fn().mockReturnValue({on: true, setDesktop: jest.fn()}),
|
||||
useHotspot: jest.fn().mockReturnValue({on: true, setHotspot: jest.fn()}),
|
||||
useThrottle: jest.fn().mockReturnValue({on: false, setThrottle: jest.fn()}),
|
||||
}));
|
||||
|
|
@ -89,6 +90,7 @@ jest.mock('../Common', () => {
|
|||
return {
|
||||
...actual,
|
||||
BluetoothToggle: () => <div data-testid="bluetooth-toggle">BluetoothToggle</div>,
|
||||
DesktopToggle: () => <div data-testid="desktop-toggle">DesktopToggle</div>,
|
||||
HotspotToggle: () => <div data-testid="hotspot-toggle">HotspotToggle</div>,
|
||||
ThrottleToggle: () => <div data-testid="throttle-toggle">ThrottleToggle</div>,
|
||||
Toggle: ({label, checked, onChange}) => (
|
||||
|
|
@ -174,6 +176,10 @@ describe('ControllerPage', () => {
|
|||
await waitFor(() => {
|
||||
expect(screen.getByText('Hardware Controls')).toBeInTheDocument();
|
||||
});
|
||||
expect(screen.getByTestId('hotspot-toggle')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('bluetooth-toggle')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('desktop-toggle')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('throttle-toggle')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('calls getServices on mount', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue