Make download progress display nicer
authorJamie Cameron <jcameron@webmin.com>
Mon, 11 Jan 2010 06:11:27 +0000 (22:11 -0800)
committerJamie Cameron <jcameron@webmin.com>
Mon, 11 Jan 2010 06:11:27 +0000 (22:11 -0800)
web-lib-funcs.pl

index 62d7435..9207847 100755 (executable)
@@ -6301,7 +6301,8 @@ elsif ($_[0] == 3) {
                if ($st != $progress_step ||
                    $time_now - $last_progress_time > 60) {
                        # Show progress every 10% or 60 seconds
-                       print $sp,&text('progress_data', $_[1], int($_[1]*100/$progress_size)),"<br>\n";
+                       print $sp,&text('progress_data', &nice_size($_[1]),
+                                       int($_[1]*100/$progress_size)),"<br>\n";
                        $last_progress_time = $time_now;
                        }
                $progress_step = $st;
@@ -6309,7 +6310,8 @@ elsif ($_[0] == 3) {
        else {
                # No total size .. so only show in 100k jumps
                if ($_[1] > $last_progress_size+100*1024) {
-                       print $sp,&text('progress_data2', $_[1]),"<br>\n";
+                       print $sp,&text('progress_data2',
+                                       &nice_size($_[1])),"<br>\n";
                        $last_progress_size = $_[1];
                        }
                }