mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-15 17:12:59 -04:00
spam fix
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -11,7 +11,7 @@
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
|
||||
<title>Multi Roomba Rover</title>
|
||||
<script type="module" crossorigin src="/assets/index-256lFfdi.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-Gqg6Q6EF.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-lg9md4T4.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -105,7 +105,27 @@ modeEvents.on('change', () => {
|
||||
syncAll();
|
||||
});
|
||||
|
||||
managerEvents.on('rover', () => {
|
||||
managerEvents.on('rover', (event = {}) => {
|
||||
if (event.action === 'nightVision') {
|
||||
const now = Date.now();
|
||||
const elapsed = now - lastNightVisionSync;
|
||||
if (elapsed >= NIGHT_VISION_SYNC_COOLDOWN_MS) {
|
||||
lastNightVisionSync = now;
|
||||
logger.info('Night vision update; syncing all clients (immediate)');
|
||||
syncAll();
|
||||
return;
|
||||
}
|
||||
if (!pendingNightVisionSync) {
|
||||
const delay = NIGHT_VISION_SYNC_COOLDOWN_MS - elapsed;
|
||||
pendingNightVisionSync = setTimeout(() => {
|
||||
lastNightVisionSync = Date.now();
|
||||
pendingNightVisionSync = null;
|
||||
logger.info('Night vision update; syncing all clients (delayed)');
|
||||
syncAll();
|
||||
}, delay);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (pendingNightVisionSync) {
|
||||
clearTimeout(pendingNightVisionSync);
|
||||
pendingNightVisionSync = null;
|
||||
@@ -114,27 +134,6 @@ managerEvents.on('rover', () => {
|
||||
syncAll();
|
||||
});
|
||||
|
||||
managerEvents.on('rover', (event = {}) => {
|
||||
if (event.action !== 'nightVision') return;
|
||||
const now = Date.now();
|
||||
const elapsed = now - lastNightVisionSync;
|
||||
if (elapsed >= NIGHT_VISION_SYNC_COOLDOWN_MS) {
|
||||
lastNightVisionSync = now;
|
||||
logger.info('Night vision update; syncing all clients (immediate)');
|
||||
syncAll();
|
||||
return;
|
||||
}
|
||||
if (!pendingNightVisionSync) {
|
||||
const delay = NIGHT_VISION_SYNC_COOLDOWN_MS - elapsed;
|
||||
pendingNightVisionSync = setTimeout(() => {
|
||||
lastNightVisionSync = Date.now();
|
||||
pendingNightVisionSync = null;
|
||||
logger.info('Night vision update; syncing all clients (delayed)');
|
||||
syncAll();
|
||||
}, delay);
|
||||
}
|
||||
});
|
||||
|
||||
managerEvents.on('lock', ({ roverId, locked }) => {
|
||||
logger.info('Rover lock change', roverId, locked);
|
||||
syncAll();
|
||||
|
||||
@@ -65,7 +65,12 @@ export default function ControlSummary() {
|
||||
</div>
|
||||
<div className="grid h-full grid-rows-[1fr_1fr_auto] gap-0.5">
|
||||
<div className="row-span-2">
|
||||
<DriveDockAction layout="desktop" expand={hideInlineControls} driveDockState={driveDockState} />
|
||||
<DriveDockAction
|
||||
layout="desktop"
|
||||
expand={hideInlineControls}
|
||||
fill={!hideInlineControls}
|
||||
driveDockState={driveDockState}
|
||||
/>
|
||||
</div>
|
||||
{!hideInlineControls ? <InlineCameraTilt keymap={keymap} /> : null}
|
||||
</div>
|
||||
|
||||
@@ -91,7 +91,7 @@ function DockModal({ instructions, onConfirm, onCancel, pending }) {
|
||||
);
|
||||
}
|
||||
|
||||
export default function DriveDockAction({ layout = 'desktop', expand = false, driveDockState }) {
|
||||
export default function DriveDockAction({ layout = 'desktop', expand = false, fill = false, driveDockState }) {
|
||||
const isMobile = layout === 'mobile';
|
||||
const {
|
||||
state: { roverId, keymap },
|
||||
@@ -186,7 +186,7 @@ export default function DriveDockAction({ layout = 'desktop', expand = false, dr
|
||||
'border-amber-300/70 bg-amber-900 text-amber-50 hover:bg-amber-800 focus-visible:ring-amber-300';
|
||||
const indigoCta =
|
||||
'border-indigo-300/70 bg-indigo-900 text-indigo-50 hover:bg-indigo-800 focus-visible:ring-indigo-300';
|
||||
const filledHeight = expand ? 'h-full flex-1' : '';
|
||||
const filledHeight = expand ? 'h-full flex-1' : fill ? 'flex-1' : '';
|
||||
|
||||
if (!driving && !dockingInProgress) {
|
||||
return (
|
||||
|
||||
@@ -39,7 +39,12 @@ function DriveDockPanel() {
|
||||
|
||||
return (
|
||||
<section className="panel-section flex h-full flex-col gap-0.5">
|
||||
<DriveDockAction layout="desktop" expand={hideInlineControls} driveDockState={driveDockState} />
|
||||
<DriveDockAction
|
||||
layout="desktop"
|
||||
expand={hideInlineControls}
|
||||
fill={!hideInlineControls}
|
||||
driveDockState={driveDockState}
|
||||
/>
|
||||
{!hideInlineControls ? <InlineCameraTilt keymap={keymap} /> : null}
|
||||
</section>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user