feat(bridge): add wifi/serial bridge runtime and UI
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
27
src/static/zone-devices-panel.js
Normal file
27
src/static/zone-devices-panel.js
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Scrollable device/group list with a fixed add row (dropdown + button) below.
|
||||
* Used by group and zone edit modals.
|
||||
*/
|
||||
function prepareZoneDevicesPanel(containerEl) {
|
||||
if (!containerEl) return null;
|
||||
let listEl = containerEl.querySelector('.zone-devices-list');
|
||||
let addSlot = containerEl.querySelector('.zone-devices-add-slot');
|
||||
if (!listEl) {
|
||||
containerEl.innerHTML = '';
|
||||
containerEl.classList.add('zone-devices-panel');
|
||||
listEl = document.createElement('div');
|
||||
listEl.className = 'zone-devices-list';
|
||||
addSlot = document.createElement('div');
|
||||
addSlot.className = 'zone-devices-add-slot';
|
||||
containerEl.appendChild(listEl);
|
||||
containerEl.appendChild(addSlot);
|
||||
} else {
|
||||
listEl.innerHTML = '';
|
||||
addSlot.innerHTML = '';
|
||||
}
|
||||
return { listEl, addSlot };
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
window.prepareZoneDevicesPanel = prepareZoneDevicesPanel;
|
||||
}
|
||||
Reference in New Issue
Block a user