feat(bridge): add wifi/serial bridge runtime and UI

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-28 00:38:21 +12:00
parent 2cf019079e
commit 78dc8ffc77
92 changed files with 5679 additions and 1790 deletions

View File

@@ -98,29 +98,8 @@ document.addEventListener('DOMContentLoaded', () => {
: [];
};
const postDriverSequence = async (sequence, targetMacs, delayS = 0.05, pushOptions = {}) => {
if (typeof window.postDriverSequence === 'function') {
return window.postDriverSequence(sequence, targetMacs, delayS, pushOptions);
}
const body = { sequence, delay_s: delayS };
if (pushOptions && pushOptions.unicast === true) {
body.unicast = true;
if (Array.isArray(targetMacs) && targetMacs.length) {
body.targets = [...new Set(targetMacs)];
}
}
const res = await fetch('/presets/push', {
method: 'POST',
headers: { 'Content-Type': 'application/json', Accept: 'application/json' },
credentials: 'same-origin',
body: JSON.stringify(body),
});
if (!res.ok) {
const err = await res.json().catch(() => ({}));
throw new Error((err && err.error) || res.statusText || 'Send failed');
}
return res.json().catch(() => ({}));
};
const postDriverSequence = (sequence, targetMacs, delayS, pushOptions) =>
window.postDriverSequence(sequence, targetMacs, delayS, pushOptions);
const nReadableStringFromMeta = (meta, key) => {
if (!meta || typeof meta !== 'object') {