fix(led-tool): harden Web Serial raw REPL connect

Improve boot wait, readUntil buffer handling, and settings editor
host/Web Serial flows after device reset.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-05-19 00:23:08 +12:00
parent f74e21f206
commit bd4d2060ae
3 changed files with 353 additions and 54 deletions

View File

@@ -185,10 +185,11 @@
document.body.getAttribute('data-api-base') ??
(location.pathname.includes('/led-tool') ? '/led-tool' : '');
const prefix = api + '/static';
const v = '20260520';
function loadScript(url) {
return new Promise((resolve, reject) => {
const s = document.createElement('script');
s.src = url;
s.src = url + (url.includes('?') ? '&' : '?') + 'v=' + v;
s.onload = () => resolve();
s.onerror = () => reject(new Error('Failed to load ' + url));
document.body.appendChild(s);