From e2fa49620b620bb6d6fb57c71f320e69047b8f0f Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 26 Mar 2005 21:00:25 +0000 Subject: Add upload progress bar support to manual upgrade firmware --- usr/local/www/progress.php | 85 +++++++++++++++++++++++++++++++++++++++ usr/local/www/system_firmware.php | 8 +++- 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100755 usr/local/www/progress.php (limited to 'usr/local') diff --git a/usr/local/www/progress.php b/usr/local/www/progress.php new file mode 100755 index 0000000..8826f4a --- /dev/null +++ b/usr/local/www/progress.php @@ -0,0 +1,85 @@ +#!/usr/local/bin/php + + Invalid meter ID!'); + }else{ + echo (''); + } + +}else{ + + $meter = sprintf("%.2f", $X['bytes_uploaded'] / $X['bytes_total'] * 100); + + $sp = $X['speed_last']; + if ($sp < 10000) $speed = sprintf("%.2f", $sp / 1000); + else $speed = sprintf("%d", $sp / 1000); + + $eta = sprintf("%02d:%02d", $X['est_sec'] / 60, $X['est_sec'] % 60 ); + + $upl = nice_value($X['bytes_uploaded']); + $total = nice_value($X['bytes_total']); + + if ($X['bytes_total'] > 1 && $X['bytes_uploaded'] >= $X['bytes_total'] && $X['est_sec'] == 0) { + echo (' UPLOAD completed!'); + }else{ + +?> + + + + + + +Uploading Files... Please wait ... + + + + + + +Uploading files... + +
+ + +  \n"); + } + ?> + +
+
+ +
+ left (at KB/sec) + +/(%) +
+ +
+ + + + + + + diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index d6afe94..7204047 100755 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -170,6 +170,12 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { else $fwinfo = "Using alternate firmware URL, cannot determine if {$config['system']['alt_firmware_url']['firmware_base_url']}{$config['system']['alt_firmware_url']['firmware_filename']} is newer than current."; } + +$id = rand() . '.' . time(); + +$mth = ini_get('upload_progress_meter.store_method'); +$dir = ini_get('upload_progress_meter.file.filename_template'); + ?> @@ -234,7 +240,7 @@ print_info_box($sig_warning);

Firmware image file:  

- + You must reboot the system before you can upgrade the firmware. -- cgit v1.1