Display active upload progress
This commit is contained in:
@@ -81,6 +81,7 @@
|
||||
}
|
||||
},
|
||||
setUploadProgress: (items) => {
|
||||
items = items || [];
|
||||
const table = document.getElementById('ID_UploadProgressTable');
|
||||
while (table.rows.length > items.length) {
|
||||
table.deleteRow(table.rows.length - 1);
|
||||
@@ -88,16 +89,15 @@
|
||||
for (const item of items) {
|
||||
const siaPath = item['SiaPath'];
|
||||
const progress = item['Progress'];
|
||||
const row = table.getElementById('ID_Progress_' + btoa(siaPath));
|
||||
const rid = window.btoa('progress_' + siaPath);
|
||||
const row = document.getElementById(rid);
|
||||
if (row) {
|
||||
row.cells[1].firstChild.value = progress;
|
||||
} else {
|
||||
const row = table.insertRow(table.rows.length);
|
||||
row.id = 'ID_Progress_' + btoa(siaPath);
|
||||
let cell = row.insertCell(0);
|
||||
cell.innerText = siaPath;
|
||||
cell = row.insertCell(1);
|
||||
cell.innerHTML = '<progress value="' + progress + '" max="100"></progress>';
|
||||
const r = table.insertRow(table.rows.length);
|
||||
r.insertCell(0).innerText = siaPath;
|
||||
r.insertCell(1).innerHTML = '<progress value="' + progress + '" max="100"></progress>';
|
||||
r.id = rid;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -264,6 +264,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
function handleRenterUploads() {
|
||||
setMainWindow('upload_progress_window');
|
||||
|
||||
const okButton = document.getElementById('ID_RenterUploadsOk');
|
||||
okButton.onclick = () => {
|
||||
okButton.onclick = null;
|
||||
beginMainApplication();
|
||||
};
|
||||
}
|
||||
|
||||
function beginMainApplication() {
|
||||
AppActions.startApp();
|
||||
setMainWindow('app_window');
|
||||
@@ -272,6 +282,11 @@
|
||||
renterEditLink.onclick = null;
|
||||
handleRenterEditSettings();
|
||||
};
|
||||
const renterUploadsLink = document.getElementById('ID_Renter_Uploads');
|
||||
renterUploadsLink.onclick = () => {
|
||||
renterUploadsLink.onclick = null;
|
||||
handleRenterUploads();
|
||||
};
|
||||
const mountButton = document.getElementById('ID_MountButton');
|
||||
const mountSelect = document.getElementById('ID_MountDrives');
|
||||
|
||||
|
Reference in New Issue
Block a user