fix for file transfer: sort row and remove empty dir

This commit is contained in:
rustdesk 2021-07-26 02:50:33 +08:00
parent 9a86a595ff
commit 1ee92c9f68
2 changed files with 8 additions and 4 deletions

View File

@ -146,11 +146,15 @@ class JobTable: Reactor.Component {
var n = job.num_entries || job.entries.length;
if (i > n) i = n;
var res = i + ' / ' + n + " files";
if (job.total_size > 0) res += ", " + getSize(0, job.finished_size) + ' / ' + getSize(0, job.total_size);
if (job.total_size > 0) {
var s = getSize(0, job.finished_size);
if (s) s += " / ";
res += ", " + s + getSize(0, job.total_size);
}
// below has problem if some file skipped
var percent = (100. * job.finished_size / job.total_size).toInteger(); // (100. * i / (n || 1)).toInteger();
var percent = job.total_size == 0 ? 100 : (100. * job.finished_size / job.total_size).toInteger(); // (100. * i / (n || 1)).toInteger();
if (job.finished) percent = '100';
res += ", " + percent + "%";
if (percent) res += ", " + percent + "%";
if (job.finished) res = "Finished " + res;
if (job.speed) res += ", " + getSize(0, job.speed) + "/s";
return res;

View File

@ -73,7 +73,7 @@ class Grid: Behavior {
var getValue = function(x) {
var value = x.attributes["value"];
if (value == undefined) return x.text.toLowerCase();
return value.toInteger();
return value.toFloat();
}
var sort = function(r1, r2, asc) {
if (r1[1].text == "..") {