feat(ui): driver settings and code updates over ESP-NOW

Settings gets a Driver tab (/settings/editor). It sends a driver its settings through PUT /devices/<id>, which now forwards name too, and runs the tools/driver_ota.py session from the browser. The firmware embeds the led-driver files and a manifest of their hashes, because crypto.subtle is unavailable over plain HTTP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-11-04 23:51:41 +13:00
1 parent 2f0c26e9b8
commit 06953028ab
11 files changed
+421 -8

No files matched your search

+28
View File
@@ -165,9 +165,36 @@ document.addEventListener('DOMContentLoaded', () => {
const addIpButton = document.getElementById('static-ip-add-btn');
if (addIpButton) addIpButton.addEventListener('click', () => addStaticIpRow());
const settingsTabButtons = document.querySelectorAll('#settings-modal .settings-tab-btn');
const settingsTabPanels = document.querySelectorAll('#settings-modal .settings-tab-panel');
const ledToolIframe = document.getElementById('led-tool-iframe');
function switchSettingsTab(tabId) {
for (const btn of settingsTabButtons) {
const on = btn.getAttribute('data-settings-tab') === tabId;
btn.classList.toggle('active', on);
btn.setAttribute('aria-selected', on ? 'true' : 'false');
}
for (const panel of settingsTabPanels) {
const on = panel.getAttribute('data-settings-panel') === tabId;
panel.classList.toggle('active', on);
panel.hidden = !on;
}
settingsModal.classList.toggle('settings-modal--led-tool', tabId === 'led-tool');
if (ledToolIframe) {
// Loaded on demand, so the Controller tab costs no requests
ledToolIframe.src = tabId === 'led-tool' ? '/settings/editor' : 'about:blank';
}
}
for (const btn of settingsTabButtons) {
btn.addEventListener('click', () => switchSettingsTab(btn.getAttribute('data-settings-tab')));
}
if (settingsButton && settingsModal) {
settingsButton.addEventListener('click', () => {
settingsModal.classList.add('active');
switchSettingsTab('controller');
loadDeviceSettings();
});
}
@@ -175,6 +202,7 @@ document.addEventListener('DOMContentLoaded', () => {
if (settingsCloseButton && settingsModal) {
settingsCloseButton.addEventListener('click', () => {
settingsModal.classList.remove('active');
switchSettingsTab('controller');
});
}