- index.html: minimal shell with <template> elements for all repeated DOM structures (node-item, device-group, device-item, ctrl-group, ctrl-row, capture-badge); links external style.css - style.css: all styles extracted from index.html - lib/dom.mjs: by_id, qs, clone, show, hide helpers - app.mjs: persistent SSE node list replaces Discover button; clicking a node connects to it; uses clone()/replaceChildren() throughout; no innerHTML for structure; event wiring at bottom Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6 lines
345 B
JavaScript
6 lines
345 B
JavaScript
export const by_id = id => document.getElementById(id);
|
|
export const qs = (sel, root = document) => root.querySelector(sel);
|
|
export const clone = id => document.getElementById(id).content.cloneNode(true).firstElementChild;
|
|
export const show = el => el.removeAttribute('hidden');
|
|
export const hide = el => el.setAttribute('hidden', '');
|