diff --git a/internal/web/ui/templates/console.html b/internal/web/ui/templates/console.html index 258ae10..229ac60 100644 --- a/internal/web/ui/templates/console.html +++ b/internal/web/ui/templates/console.html @@ -248,7 +248,8 @@ box.style.cssText = 'background:var(--surface);border-radius:8px;padding:20px;min-width:300px;max-width:400px'; box.addEventListener('click',function(e){e.stopPropagation()}); box.innerHTML = '
为设备添加视频源 (' + visible.length + '路可用)
' + - '
'; + '
'; + var list = box.querySelector('div:last-child'); visible.forEach(function(name) { var item = document.createElement('div'); item.textContent = name; @@ -259,10 +260,13 @@ addSourceToDeviceForm(deviceID, name); overlay.remove(); }); - box.querySelector('div:last-child').appendChild(item); + list.appendChild(item); }); - box.innerHTML += '
'; - box.querySelector('button').addEventListener('click',function(){overlay.remove()}); + var footer = document.createElement('div'); + footer.style.cssText = 'margin-top:12px;text-align:right'; + footer.innerHTML = ''; + footer.querySelector('button').addEventListener('click',function(){overlay.remove()}); + box.appendChild(footer); overlay.appendChild(box); document.body.appendChild(overlay); }; @@ -306,7 +310,8 @@ box.style.cssText = 'background:var(--surface);border-radius:8px;padding:20px;min-width:300px;max-width:400px'; box.addEventListener('click',function(e){e.stopPropagation()}); box.innerHTML = '
分配 "' + sourceName + '" 到设备
' + - '
'; + '
'; + var list = box.querySelector('div:last-child'); rows.forEach(function(row) { var did = row.getAttribute('data-device-id'); var nameEl = row.querySelector('.console-device-name'); @@ -322,10 +327,13 @@ addSourceToDeviceForm(did, sourceName); overlay.remove(); }); - box.querySelector('div:last-child').appendChild(item); + list.appendChild(item); }); - box.innerHTML += '
'; - box.querySelector('button').addEventListener('click',function(){overlay.remove()}); + var footer = document.createElement('div'); + footer.style.cssText = 'margin-top:12px;text-align:right'; + footer.innerHTML = ''; + footer.querySelector('button').addEventListener('click',function(){overlay.remove()}); + box.appendChild(footer); overlay.appendChild(box); document.body.appendChild(overlay); } diff --git a/safesightd-linux-arm64 b/safesightd-linux-arm64 index 16205f5..323136f 100644 Binary files a/safesightd-linux-arm64 and b/safesightd-linux-arm64 differ