1
0

Display active upload progress

This commit is contained in:
Scott E. Graves
2017-04-15 16:50:35 -05:00
parent 290ddaf388
commit ee60720f0b
5 changed files with 54 additions and 20 deletions

View File

@@ -176,8 +176,9 @@
<div class="hidden-element" id="upload_progress_window">
<div class="box">
<h1>Upload Progress</h1>
<table style="width: 100%" id="ID_UploadProgressTable">
<table style="width: 100%;height: auto" id="ID_UploadProgressTable">
</table>
<button id="ID_RenterUploadsOk" type="button">OK</button>
</div>
</div>
</body>

View File

@@ -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');