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;