mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 11:56:01 +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:
@@ -167,12 +167,9 @@ export function SpoolBuddyLayout() {
|
||||
touchStartRef.current = null;
|
||||
swipeLockedRef.current = false;
|
||||
|
||||
// Vertical swipe: open/close quick menu
|
||||
if (Math.abs(dy) >= SWIPE_THRESHOLD && Math.abs(dy) > Math.abs(dx)) {
|
||||
if (dy > 0 && startY < 80) {
|
||||
// Swipe down from top area → open quick menu
|
||||
setQuickMenuOpen(true);
|
||||
}
|
||||
// Vertical swipe down from top edge → open quick menu
|
||||
if (dy >= SWIPE_THRESHOLD && Math.abs(dy) > Math.abs(dx) && startY < 80) {
|
||||
setQuickMenuOpen(true);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1
-1
@@ -23,7 +23,7 @@
|
||||
|
||||
<!-- Splash screens for iOS -->
|
||||
<link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
|
||||
<script type="module" crossorigin src="/assets/index-DPDJoHI3.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-C5rdBDsu.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-nqJ5Rq6m.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user