summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/pkg_mgr_install.php
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-10-27 09:26:12 -0400
committerStephen Beaver <sbeaver@netgate.com>2015-10-27 09:26:12 -0400
commit3985bb3c324bfd6e51c5d458e6f72f8395665837 (patch)
tree6d93a2dcaaf43fa70770e7ccd733448cffa66eee /src/usr/local/www/pkg_mgr_install.php
parentd41aeafcb335c30dc83ad17b8d85b53c1efed78f (diff)
downloadpfsense-3985bb3c324bfd6e51c5d458e6f72f8395665837.zip
pfsense-3985bb3c324bfd6e51c5d458e6f72f8395665837.tar.gz
Accommodate possible bug in pkg where progress total is reported as zero
Diffstat (limited to 'src/usr/local/www/pkg_mgr_install.php')
-rw-r--r--src/usr/local/www/pkg_mgr_install.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php
index e3cc39f..7b8e872 100644
--- a/src/usr/local/www/pkg_mgr_install.php
+++ b/src/usr/local/www/pkg_mgr_install.php
@@ -513,8 +513,16 @@ function getLogsStatus() {
if("<?=$progbar?>") {
if (json.data) {
- setProgress('progressbar', ((json.data.current * 100) / json.data.total), true);
+ // There appears to be a bug in pkg that can cause "total" to be reported as zero
+ if (json.data.total > 0) {
+ setProgress('progressbar', ((json.data.current * 100) / json.data.total), true);
+ }
+
progress = json.data.total - json.data.current
+ if (progress < 0) {
+ progress = 0;
+ }
+
}
}
// Now we need to determine if the installation/removal was successful, and tell the user. Not as easy as it sounds :)
@@ -551,8 +559,8 @@ events.push(function(){
// we only meed to re-populate the progress indicator and the status banner
if ( "<?=$_POST['completed']?>" == "true") {
setProgress('progressbar', 100, false);
- scrollToBottom();
show_success();
+ setTimeout(scrollToBottom, 200);
}
});
//]]>
OpenPOWER on IntegriCloud