diff --git a/clean.sh b/clean.sh index 87376f8..0da9b44 100755 --- a/clean.sh +++ b/clean.sh @@ -1,7 +1,5 @@ #!/bin/bash -/mnt/converter tree -rm -rf /mnt/converter/in/* -rm -rf /mnt/converter/out/* +rm -rf /mnt/converter/tmp/* rm -rf /mnt/converter/backend/__pycache__/ systemctl restart vm-bench-backend.service systemctl status vm-bench-backend.service diff --git a/frontend/templates/index.html b/frontend/templates/index.html index 93db70b..6d05d73 100644 --- a/frontend/templates/index.html +++ b/frontend/templates/index.html @@ -159,10 +159,13 @@ async function handleUpload(formData) { xhr.upload.addEventListener('progress', (e) => { if (e.lengthComputable) { const pct = Math.round((e.loaded / e.total) * 100); - setPhase('Uploading source file... ' + (e.loaded / (1024**3)).toFixed(1) + ' GiB', pct, false); + const mb = (e.loaded / (1024**2)).toFixed(0); + const gb = (e.loaded / (1024**3)).toFixed(1); + const size = e.loaded > 100*1024*1024 ? gb + ' GiB' : mb + ' MB'; + setPhase('Uploading source file... ' + size, pct, false); } else { - // Fallback: show bytes uploaded even without total - setPhase('Uploading source file... ' + (e.loaded / (1024**3)).toFixed(1) + ' GiB', 0, true); + const mb = (e.loaded / (1024**2)).toFixed(0); + setPhase('Uploading source file... ' + mb + ' MB', 0, true); } });