mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
teraria
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-DNSnH2id.js"></script>
|
<script type="module" crossorigin src="/assets/index-BdPhVyWy.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/assets/index-C4V7xiyW.css">
|
<link rel="stylesheet" crossorigin href="/assets/index-C4V7xiyW.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default function AdvancedSettings() {
|
|||||||
if (!roverId) return;
|
if (!roverId) return;
|
||||||
setSensorStream(enable);
|
setSensorStream(enable);
|
||||||
};
|
};
|
||||||
|
// why is this broken
|
||||||
return (
|
return (
|
||||||
<div className="space-y-1">
|
<div className="space-y-1">
|
||||||
<KeymapSettings />
|
<KeymapSettings />
|
||||||
|
|||||||
@@ -98,6 +98,23 @@ export function ControlSystemProvider({ children }) {
|
|||||||
[pipeline],
|
[pipeline],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const persistSettings = useCallback(
|
||||||
|
(partial) => {
|
||||||
|
const merged = { ...(state.settings.data ?? {}), ...(partial ?? {}) };
|
||||||
|
const success = saveControlSettings(merged);
|
||||||
|
if (success) {
|
||||||
|
dispatch({ type: 'control/settings/loaded', payload: merged });
|
||||||
|
} else {
|
||||||
|
dispatch({
|
||||||
|
type: 'control/settings/error',
|
||||||
|
payload: new Error('Failed to save control settings'),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return success;
|
||||||
|
},
|
||||||
|
[state.settings.data],
|
||||||
|
);
|
||||||
|
|
||||||
const updateKeyBinding = useCallback(
|
const updateKeyBinding = useCallback(
|
||||||
(bindingId, keyValue) => {
|
(bindingId, keyValue) => {
|
||||||
if (!bindingId) return false;
|
if (!bindingId) return false;
|
||||||
@@ -207,23 +224,6 @@ export function ControlSystemProvider({ children }) {
|
|||||||
dispatch({ type: 'control/settings/loaded', payload: next });
|
dispatch({ type: 'control/settings/loaded', payload: next });
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const persistSettings = useCallback(
|
|
||||||
(partial) => {
|
|
||||||
const merged = { ...(state.settings.data ?? {}), ...(partial ?? {}) };
|
|
||||||
const success = saveControlSettings(merged);
|
|
||||||
if (success) {
|
|
||||||
dispatch({ type: 'control/settings/loaded', payload: merged });
|
|
||||||
} else {
|
|
||||||
dispatch({
|
|
||||||
type: 'control/settings/error',
|
|
||||||
payload: new Error('Failed to save control settings'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
},
|
|
||||||
[state.settings.data],
|
|
||||||
);
|
|
||||||
|
|
||||||
const contextValue = useMemo(
|
const contextValue = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
state,
|
state,
|
||||||
|
|||||||
Reference in New Issue
Block a user