debug: add progress/loadstart console.logs

This commit is contained in:
Claus Lohmar 2026-07-22 09:16:12 +00:00
parent 4428d91feb
commit 0f69e725a5

View file

@ -152,6 +152,7 @@ async function handleUpload(formData) {
xhr.setRequestHeader('X-VM-Name', vmName);
xhr.upload.addEventListener('progress', (e) => {
console.log('progress', e.loaded, '/', e.total, 'computable:', e.lengthComputable);
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);
@ -162,6 +163,7 @@ async function handleUpload(formData) {
});
xhr.addEventListener('loadstart', () => {
console.log('loadstart');
setPhase('Uploading source file...', 0, true);
});