mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-20 00:38:38 +02:00
Add SpoolBuddy quick menu with power control and system commands (#893)
Swipe down from the top of the SpoolBuddy display to open a quick-access
menu for toggling printer smart plugs and managing the device (restart
daemon, restart browser, reboot, shutdown). All destructive actions
require confirmation.
Backend: new POST /spoolbuddy/devices/{id}/system/command endpoint
queuing reboot/shutdown/restart_daemon/restart_browser commands.
Daemon: handles commands via subprocess (sudo reboot, systemctl restart).
Frontend: SpoolBuddyQuickMenu component, swipe-down gesture detection,
i18n keys for all 7 locales.
This commit is contained in:
@@ -5267,6 +5267,12 @@ export const spoolbuddyApi = {
|
||||
body: '{}',
|
||||
}),
|
||||
|
||||
systemCommand: (deviceId: string, command: 'reboot' | 'shutdown' | 'restart_daemon' | 'restart_browser') =>
|
||||
request<{ status: string; command: string }>(`/spoolbuddy/devices/${deviceId}/system/command`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ command }),
|
||||
}),
|
||||
|
||||
queueDiagnostics: (deviceId: string, type: 'nfc' | 'scale' | 'read_tag') =>
|
||||
request<{ status: string; diagnostic: string; message: string }>(
|
||||
`/spoolbuddy/diagnostics/${deviceId}/run?diagnostic=${type}`,
|
||||
|
||||
Reference in New Issue
Block a user