Spaces:
Sleeping
Sleeping
Update templates/home.html
Browse files- templates/home.html +16 -1
templates/home.html
CHANGED
|
@@ -849,7 +849,7 @@ async function startWc(){
|
|
| 849 |
}catch(e){
|
| 850 |
console.error('Frame interval error:',e);
|
| 851 |
}
|
| 852 |
-
},
|
| 853 |
|
| 854 |
/* Grand panel droite */
|
| 855 |
document.getElementById('emptyState').style.display='none';
|
|
@@ -899,6 +899,8 @@ function _saveRec(){
|
|
| 899 |
document.getElementById('srcLabel').textContent='Webcam — recorded';
|
| 900 |
document.getElementById('emptyState').style.display='none';
|
| 901 |
_hideResultOverlays();
|
|
|
|
|
|
|
| 902 |
/* Active download */
|
| 903 |
_set('dlName','webcam_trackiq.webm');
|
| 904 |
document.getElementById('dlBtn').removeAttribute('disabled');
|
|
@@ -933,6 +935,19 @@ function stopWc(){
|
|
| 933 |
checkReady();
|
| 934 |
}
|
| 935 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 936 |
async function _pollWc(){
|
| 937 |
try{
|
| 938 |
const r=await fetch('/api/webcam/stats');
|
|
|
|
| 849 |
}catch(e){
|
| 850 |
console.error('Frame interval error:',e);
|
| 851 |
}
|
| 852 |
+
},200);
|
| 853 |
|
| 854 |
/* Grand panel droite */
|
| 855 |
document.getElementById('emptyState').style.display='none';
|
|
|
|
| 899 |
document.getElementById('srcLabel').textContent='Webcam — recorded';
|
| 900 |
document.getElementById('emptyState').style.display='none';
|
| 901 |
_hideResultOverlays();
|
| 902 |
+
/* FIX: remplir les stats webcam */
|
| 903 |
+
_pollWcFinal();
|
| 904 |
/* Active download */
|
| 905 |
_set('dlName','webcam_trackiq.webm');
|
| 906 |
document.getElementById('dlBtn').removeAttribute('disabled');
|
|
|
|
| 935 |
checkReady();
|
| 936 |
}
|
| 937 |
|
| 938 |
+
async function _pollWcFinal(){
|
| 939 |
+
try{
|
| 940 |
+
const r=await fetch('/api/webcam/stats');
|
| 941 |
+
if(!r.ok)return;
|
| 942 |
+
const d=await r.json();
|
| 943 |
+
const uc=d.unique_counts||{};
|
| 944 |
+
const totalUnique=Object.values(uc).reduce((a,b)=>a+b,0);
|
| 945 |
+
_set('stF', d.frame||0);
|
| 946 |
+
_set('stO', totalUnique||0);
|
| 947 |
+
_set('stFps', '~5');
|
| 948 |
+
_set('stD', Math.round((d.frame||0)/5)+'s');
|
| 949 |
+
}catch(e){}
|
| 950 |
+
}
|
| 951 |
async function _pollWc(){
|
| 952 |
try{
|
| 953 |
const r=await fetch('/api/webcam/stats');
|