Project

General

Profile

« Previous | Next » 

Revision 1b934970

Added by Colin Smith about 20 years ago

  • Move download begin/finish text to status window.
  • Move download percentage indicator to status window and comment out the output window indicator.
  • Reserve the output window for release comments.

View differences:

usr/local/www/system_firmware_auto.php
96 96
		if($versions[1] != $firmware_version) $needs_firmware_upgrade = true;
97 97
		if($versions[2] != $kernel_version) $needs_kernel_upgrade = true;
98 98
		if($versions[3] != $base_version) $needs_base_version = true;
99
		if(isset($versions[4])) update_output_window($versions[3]); // If we have additional data (a CHANGELOG etc) to display, do so.
99
		if(isset($versions[4])) $static_text = $versions[4] . '\n'; // If we have additional data (a CHANGELOG etc) to display, do so.
100
		update_output_window($static_text);
100 101
	} else {
101 102
		update_status("No updates required.");
102 103
	}
......
106 107
}
107 108

  
108 109
if($needs_firmware_upgrade == true) {
109
	update_status("Downloading firmware update...");
110
	$static_status = "Downloading firmware update... ";
111
	update_status($static_status);
110 112
	$status = download_file_with_progress_bar("http://www.pfSense.com/latest.tgz", "/tmp/latest.tgz");
111
	update_output_window("Firmware download complete.");
113
	$static_status .= "done. ";
112 114
}
113 115

  
114 116
if($needs_kernel_upgrade == true) {
115
	update_status("Downloading kernel update...");
117
	$static_status .= "Downloading kernel update... ";
118
	update_status($static_status);
116 119
	$status = download_file_with_progress_bar("http://www.pfSense.com/latest_kernel{$platform}.tgz", "/tmp/latest_kernel.tgz");
117
	update_output_window("Kernel download complete.");
120
	$static_status .= "done. ";
121
}
118 122

  
119 123
if($needs_base_upgrade == true) {
120
	update_status("Downloading base update...");
124
	$static_status .= "Downloading base update... ";
125
	update_status($static_status);
121 126
	$status = download_file_with_progress_bar("http://www.pfSense.com/latest_base.tgz", "/tmp/latest_base.tgz");
122
	update_output_window("Base update complete.");
127
	$static_status .= "done. ";
128
	update_status($static_status);
123 129
}
124 130

  
125 131
/* launch external upgrade helper */
......
191 197
	$downloaded += intval($length);
192 198
	$downloadProgress = round(100 * (1 - $downloaded / $file_size), 0);
193 199
	$downloadProgress = 100 - $downloadProgress;
200
	/*
194 201
	$a = $file_size;
195 202
	$b = $downloaded;
196 203
	$c = $downloadProgress;
197
	$text  = "  Download Status\\n";
204
	$text .= "  Download Status\\n";
198 205
	$text .= "---------------------------------\\n";
199 206
	$text .= "  File size  : {$a}\\n";
200 207
	$text .= "  Downloaded : {$b}\\n";
201 208
	$text .= "  Percent    : {$c}%\\n";
202 209
	$text .= "---------------------------------\\n";
210
	*/
203 211
	$counter++;
204 212
	if($counter > 150) {
205
		update_output_window($text);
213
		$tostatus = $static_status . $downloadProgress;
214
		update_status($tostatus);
206 215
		update_progress_bar($downloadProgress);
207 216
		$counter = 0;
208 217
	}

Also available in: Unified diff