feat(ui): hide device management behind ⚙ MANAGE toggle — form and remove buttons only shown when active

This commit is contained in:
Claude
2026-04-05 20:59:35 +00:00
parent a024e762c0
commit 82995de95a
3 changed files with 42 additions and 2 deletions

View File

@@ -115,11 +115,18 @@ function escapeHtml(str) {
loadDevices();
document.getElementById("devices-manage-toggle").addEventListener("click", () => {
const panel = document.getElementById("devices-panel");
const btn = document.getElementById("devices-manage-toggle");
const active = panel.classList.toggle("manage-active");
btn.classList.toggle("active", active);
});
document.getElementById("add-device-form").addEventListener("submit", async (e) => {
e.preventDefault();
const form = e.target;
const data = {
name: form.name.value.trim(),
name: form.elements["name"].value.trim(),
strip_type: form.strip_type.value,
led_count: parseInt(form.led_count.value, 10),
ip: form.ip.value.trim(),