From b5f93f7488509da7f44717529b2a9a5aa900e20f Mon Sep 17 00:00:00 2001 From: JKH Date: Sat, 6 Jun 2026 11:09:59 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=9E=9C=EB=94=A9=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20XSS=20=EC=B7=A8=EC=95=BD=EC=A0=90=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(innerHTML=20=E2=86=92=20textContent)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 8d36c6b..c78a522 100644 --- a/index.html +++ b/index.html @@ -292,13 +292,13 @@
Registered Robots
function checkServer(){var d=document.getElementById('statusDot'),t=document.getElementById('statusText');fetch(B+'/health_check').then(function(r){if(r.ok){d.className='status-dot online';t.textContent='Server Online';}else{d.className='status-dot offline';t.textContent='Unhealthy';}}).catch(function(){d.className='status-dot offline';t.textContent='Server Offline';});} checkServer(); function toggle(h){var b=h.nextElementSibling,t=h.querySelector('.endpoint-toggle');b.classList.toggle('open');t.style.transform=b.classList.contains('open')?'rotate(180deg)':'';} -function showResp(id,s,d,m){var b=document.getElementById(id),ok=s>=200&&s<300;b.className='response-box visible';b.innerHTML='
'+s+''+(ok?'Success':'Error')+''+m+'ms
'+(typeof d==='string'?d:JSON.stringify(d,null,2))+'
';} +function showResp(id,s,d,m){var b=document.getElementById(id),ok=s>=200&&s<300;b.className='response-box visible';b.innerHTML='
'+(ok?'Success':'Error')+'
';b.querySelector('.status-code').textContent=s;b.querySelector('.response-time').textContent=m+'ms';b.querySelector('.response-body-output').textContent=(typeof d==='string'?d:JSON.stringify(d,null,2));} function showLoad(id){var b=document.getElementById(id);b.className='response-box visible';b.innerHTML='
Sending...
';} -function showErr(id,m){var b=document.getElementById(id);b.className='response-box visible';b.innerHTML='
Error
'+m+'
';} +function showErr(id,m){var b=document.getElementById(id);b.className='response-box visible';b.innerHTML='
Error
';b.querySelector('.response-body-output').textContent=m;} function api(method,path,body){var s=performance.now(),o={method:method,headers:{'Content-Type':'application/json'}};if(body)o.body=JSON.stringify(body);return fetch(B+path,o).then(function(r){var m=Math.round(performance.now()-s);return r.json().then(function(d){return{status:r.status,data:d,ms:m};}).catch(function(){return r.text().then(function(t){return{status:r.status,data:t,ms:m};});});});} function unlock(){['lock-post-sensor','lock-get-sensor','lock-filter-sensor','lock-stats'].forEach(function(id){document.getElementById(id).classList.add('unlocked');});} function lock(){['lock-post-sensor','lock-get-sensor','lock-filter-sensor','lock-stats'].forEach(function(id){document.getElementById(id).classList.remove('unlocked');});} -function updateRL(){var el=document.getElementById('registeredRobots');if(!R.length){el.innerHTML='아직 등록된 로봇이 없습니다.';return;}el.innerHTML=R.map(function(r){return'
#'+r.id+''+r.name+'
';}).join('');} +function updateRL(){var el=document.getElementById('registeredRobots');if(!R.length){el.innerHTML='아직 등록된 로봇이 없습니다.';return;}el.innerHTML='';R.forEach(function(r){var chip=document.createElement('div');chip.className='robot-chip';var idSpan=document.createElement('span');idSpan.className='chip-id';idSpan.textContent='#'+r.id;var nameSpan=document.createElement('span');nameSpan.className='chip-name';nameSpan.textContent=r.name;chip.appendChild(idSpan);chip.appendChild(nameSpan);el.appendChild(chip);});} var MODELS=['Warehouse-Bot-v2','Patrol-Bot-X1','Cargo-Mover-3K','Scout-Mini','HeavyLift-900','SpeedRunner-S','Inspector-Pro','CleanBot-Z','Picker-Alpha','Navigator-V5']; var autoTimer=null,autoSentN=0,autoErrN=0,autoTotalMs=0;