diff --git a/src/editor.html b/src/editor.html index 2cc80ff..d149f29 100644 --- a/src/editor.html +++ b/src/editor.html @@ -379,7 +379,6 @@ function draw() { var isSel=selNode&&selNode.id===n.id; var isCF=connFrom&&connFrom.id===n.id; var isMultiSel=multiSel.indexOf(n)>=0; - var isMultiSel=multiSel.indexOf(n)>=0; if(isSel||isMultiSel){ctx.shadowColor=n.color||'#00d4aa';ctx.shadowBlur=16;} ctx.fillStyle='#161b22'; ctx.strokeStyle=isCF?'#ffa502':(isMultiSel?'#00d4aa':(isSel?(n.color||'#00d4aa'):'#30363d')); diff --git a/src/index.html b/src/index.html index c09963f..b9e0f40 100644 --- a/src/index.html +++ b/src/index.html @@ -10,6 +10,50 @@ --accent:#00d4aa; --accent2:#0099ff; --danger:#ff4757; --warn:#ffa502; --text:#e6edf3; --muted:#7d8590; --online:#26de81; --purple:#a78bfa; } +var DEVICE_TYPE_OPTIONS = [ + 'Windows-PC', + 'Linux-Server', + 'NAS/Storage', + 'Kamera/CCTV', + 'Alarmanlage/Security', + 'Router/Access Point', + 'Drucker', + 'IoT/Smart-Device', + 'Virtualisierungs-Host', + 'Konsole/Mediengeraet' +]; + +function getForcedDeviceType(ip) { + var p = deviceProfiles[ip]; + if (!p || !p.forcedType) return 'auto'; + return p.forcedType; +} + +function buildDeviceTypeOptions(currentType) { + var html = ''; + DEVICE_TYPE_OPTIONS.forEach(function(t) { + html += ''; + }); + return html; +} + +async function setDeviceClass(ip, selectedType) { + if (!ip) return; + if (selectedType === 'auto') { + delete deviceProfiles[ip]; + } else { + deviceProfiles[ip] = deviceProfiles[ip] || {}; + deviceProfiles[ip].forcedType = selectedType; + } + await api.saveDeviceProfiles(deviceProfiles); + + var activeItem = document.querySelector('.device-item.active'); + if (activeItem) { + var d = devices.find(function(x){return x.ip===ip;}); + if (d) selectDevice(d, activeItem); + } + showToast('Geräteklasse gespeichert', selectedType==='auto' ? 'Auto-Erkennung aktiv' : selectedType+' manuell gesetzt', 'info'); +} .light { --bg:#f6f8fa; --surface:#ffffff; --surface2:#f0f2f5; --border:#d0d7de; --text:#24292f; --muted:#57606a; --surface2:#eaeef2; @@ -323,8 +367,8 @@ body{font-family:'Segoe UI',system-ui,sans-serif;background:var(--bg);color:var(