1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-29 21:24:44 +03:00

Show file upload speed for imports

This commit is contained in:
Jo Michael
2012-04-07 20:17:49 +02:00
parent 263d0137fd
commit 952ca9efca

View File

@@ -79,10 +79,13 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
.show();
import_start = now;
}
else if (percent > 9) {
else if (percent > 9 || complete > 2000000) {
// calculate estimated time
var used_time = now - import_start;
var seconds = parseInt(((total - complete) / complete) * used_time / 1000);
var speed = '<?php echo PMA_jsFormat(__('%s/sec.'), false); ?>'
.replace('%s', formatBytes(complete / used_time * 1000, 1, PMA_messages.strDecimalSeperator));
var minutes = parseInt(seconds / 60);
seconds %= 60;
var estimated_time;
@@ -95,7 +98,7 @@ if ($_SESSION[$SESSION_KEY]["handler"]!="noplugin") {
.replace('%SEC', seconds);
}
statustext += '<br /><br />' + estimated_time;
statustext += '<br />' + speed + '<br /><br />' + estimated_time;
}
var percent_str = Math.round(percent) + '%';