mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-17 10:00:46 -04:00
guh wuh
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -5,7 +5,7 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>webui</title>
|
<title>webui</title>
|
||||||
<script type="module" crossorigin src="/assets/index-CnjaYiQQ.js"></script>
|
<script type="module" crossorigin src="/assets/index-qVLATLih.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-C_9jprs0.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-C_9jprs0.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -1,76 +0,0 @@
|
|||||||
import { useMemo } from 'react';
|
|
||||||
import { useControlSystem } from '../controls/index.js';
|
|
||||||
import AuthPanel from './AuthPanel.jsx';
|
|
||||||
import AdminPanel from './AdminPanel.jsx';
|
|
||||||
import KeymapSettings from './KeymapSettings.jsx';
|
|
||||||
import GamepadMappingSettings from './GamepadMappingSettings.jsx';
|
|
||||||
|
|
||||||
const manualTabs = [
|
|
||||||
{ key: 'start', label: 'Start OI' },
|
|
||||||
{ key: 'safe', label: 'Safe' },
|
|
||||||
{ key: 'full', label: 'Full' },
|
|
||||||
{ key: 'passive', label: 'Passive' },
|
|
||||||
{ key: 'dock', label: 'Dock' },
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function AdvancedSettings() {
|
|
||||||
const {
|
|
||||||
state: { roverId },
|
|
||||||
actions: { sendOiCommand, setSensorStream },
|
|
||||||
} = useControlSystem();
|
|
||||||
const canControl = Boolean(roverId);
|
|
||||||
|
|
||||||
const sensorButtons = useMemo(
|
|
||||||
() => [
|
|
||||||
{ key: 'start', label: 'Enable stream', enable: true },
|
|
||||||
{ key: 'stop', label: 'Disable stream', enable: false },
|
|
||||||
],
|
|
||||||
[],
|
|
||||||
);
|
|
||||||
|
|
||||||
const handleSensorToggle = (enable) => {
|
|
||||||
if (!roverId) return;
|
|
||||||
setSensorStream(enable);
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<div className="space-y-1">
|
|
||||||
<KeymapSettings />
|
|
||||||
<GamepadMappingSettings />
|
|
||||||
<section className="rounded-sm bg-[#242a32] p-1 text-sm text-slate-100">
|
|
||||||
<p className="text-xs text-slate-400">Manual OI commands</p>
|
|
||||||
<div className="mt-1 flex flex-wrap gap-1">
|
|
||||||
{manualTabs.map((tab) => (
|
|
||||||
<button
|
|
||||||
key={tab.key}
|
|
||||||
type="button"
|
|
||||||
onClick={() => sendOiCommand(tab.key)}
|
|
||||||
disabled={!canControl}
|
|
||||||
className="rounded-sm bg-black/40 px-1 py-0.5 text-xs text-slate-200 disabled:opacity-30"
|
|
||||||
>
|
|
||||||
{tab.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<section className="rounded-sm bg-[#242a32] p-1 text-sm text-slate-100">
|
|
||||||
<p className="text-xs text-slate-400">Sensor stream</p>
|
|
||||||
<div className="mt-1 flex gap-1">
|
|
||||||
{sensorButtons.map((btn) => (
|
|
||||||
<button
|
|
||||||
key={btn.key}
|
|
||||||
type="button"
|
|
||||||
onClick={() => handleSensorToggle(btn.enable)}
|
|
||||||
disabled={!canControl}
|
|
||||||
className="flex-1 rounded-sm bg-black/40 px-1 py-1 text-xs text-slate-200 disabled:opacity-30"
|
|
||||||
>
|
|
||||||
{btn.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
{!canControl && <p className="mt-1 text-xs text-slate-500">Assign a rover to toggle streams.</p>}
|
|
||||||
</section>
|
|
||||||
<AuthPanel />
|
|
||||||
<AdminPanel />
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@ import TelemetryPanel from './TelemetryPanel.jsx';
|
|||||||
import DrivePanel from './DrivePanel.jsx';
|
import DrivePanel from './DrivePanel.jsx';
|
||||||
import CameraServoPanel from './CameraServoPanel.jsx';
|
import CameraServoPanel from './CameraServoPanel.jsx';
|
||||||
import RoomCameraPanel from './RoomCameraPanel.jsx';
|
import RoomCameraPanel from './RoomCameraPanel.jsx';
|
||||||
import AdvancedSettings from './AdvancedSettings.jsx';
|
import SettingsPanel from './SettingsPanel.jsx';
|
||||||
import HelpPanel from './HelpPanel.jsx';
|
import HelpPanel from './HelpPanel.jsx';
|
||||||
import Tabs, { Tab, TabList, TabPanel, TabPanels } from './Tabs.jsx';
|
import Tabs, { Tab, TabList, TabPanel, TabPanels } from './Tabs.jsx';
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ export default function RightPaneTabs({ layout }) {
|
|||||||
</div>
|
</div>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel id="settings">
|
<TabPanel id="settings">
|
||||||
<AdvancedSettings />
|
<SettingsPanel />
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel id="help">
|
<TabPanel id="help">
|
||||||
<HelpPanel layout={layout} />
|
<HelpPanel layout={layout} />
|
||||||
|
|||||||
@@ -0,0 +1,96 @@
|
|||||||
|
import { useMemo } from 'react';
|
||||||
|
import { useControlSystem } from '../controls/index.js';
|
||||||
|
import AuthPanel from './AuthPanel.jsx';
|
||||||
|
import AdminPanel from './AdminPanel.jsx';
|
||||||
|
import KeymapSettings from './KeymapSettings.jsx';
|
||||||
|
import GamepadMappingSettings from './GamepadMappingSettings.jsx';
|
||||||
|
import Tabs, { Tab, TabList, TabPanel, TabPanels } from './Tabs.jsx';
|
||||||
|
|
||||||
|
const manualTabs = [
|
||||||
|
{ key: 'start', label: 'Start OI' },
|
||||||
|
{ key: 'safe', label: 'Safe' },
|
||||||
|
{ key: 'full', label: 'Full' },
|
||||||
|
{ key: 'passive', label: 'Passive' },
|
||||||
|
{ key: 'dock', label: 'Dock' },
|
||||||
|
];
|
||||||
|
|
||||||
|
export default function SettingsPanel() {
|
||||||
|
const {
|
||||||
|
state: { roverId },
|
||||||
|
actions: { sendOiCommand, setSensorStream },
|
||||||
|
} = useControlSystem();
|
||||||
|
const canControl = Boolean(roverId);
|
||||||
|
|
||||||
|
const sensorButtons = useMemo(
|
||||||
|
() => [
|
||||||
|
{ key: 'start', label: 'Enable stream', enable: true },
|
||||||
|
{ key: 'stop', label: 'Disable stream', enable: false },
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
|
||||||
|
const handleSensorToggle = (enable) => {
|
||||||
|
if (!roverId) return;
|
||||||
|
setSensorStream(enable);
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<Tabs defaultTab="keybindings">
|
||||||
|
<TabList>
|
||||||
|
<Tab id="keybindings">Keybindings</Tab>
|
||||||
|
<Tab id="controller">Controller</Tab>
|
||||||
|
<Tab id="admin">Admin</Tab>
|
||||||
|
</TabList>
|
||||||
|
<TabPanels>
|
||||||
|
<TabPanel id="keybindings">
|
||||||
|
<div className="space-y-1">
|
||||||
|
<KeymapSettings />
|
||||||
|
</div>
|
||||||
|
</TabPanel>
|
||||||
|
<TabPanel id="controller">
|
||||||
|
<div className="space-y-1">
|
||||||
|
<GamepadMappingSettings />
|
||||||
|
</div>
|
||||||
|
</TabPanel>
|
||||||
|
<TabPanel id="admin">
|
||||||
|
<div className="space-y-1">
|
||||||
|
<section className="rounded-sm bg-[#242a32] p-1 text-sm text-slate-100">
|
||||||
|
<p className="text-xs text-slate-400">Manual OI commands</p>
|
||||||
|
<div className="mt-1 flex flex-wrap gap-1">
|
||||||
|
{manualTabs.map((tab) => (
|
||||||
|
<button
|
||||||
|
key={tab.key}
|
||||||
|
type="button"
|
||||||
|
onClick={() => sendOiCommand(tab.key)}
|
||||||
|
disabled={!canControl}
|
||||||
|
className="rounded-sm bg-black/40 px-1 py-0.5 text-xs text-slate-200 disabled:opacity-30"
|
||||||
|
>
|
||||||
|
{tab.label}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
<section className="rounded-sm bg-[#242a32] p-1 text-sm text-slate-100">
|
||||||
|
<p className="text-xs text-slate-400">Sensor stream</p>
|
||||||
|
<div className="mt-1 flex gap-1">
|
||||||
|
{sensorButtons.map((btn) => (
|
||||||
|
<button
|
||||||
|
key={btn.key}
|
||||||
|
type="button"
|
||||||
|
onClick={() => handleSensorToggle(btn.enable)}
|
||||||
|
disabled={!canControl}
|
||||||
|
className="flex-1 rounded-sm bg-black/40 px-1 py-1 text-xs text-slate-200 disabled:opacity-30"
|
||||||
|
>
|
||||||
|
{btn.label}
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
{!canControl && <p className="mt-1 text-xs text-slate-500">Assign a rover to toggle streams.</p>}
|
||||||
|
</section>
|
||||||
|
<AuthPanel />
|
||||||
|
<AdminPanel />
|
||||||
|
</div>
|
||||||
|
</TabPanel>
|
||||||
|
</TabPanels>
|
||||||
|
</Tabs>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user