summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/pkg_mgr_install.php
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2016-06-23 13:29:44 -0400
committerStephen Beaver <sbeaver@netgate.com>2016-06-23 13:30:38 -0400
commit18295ff2f907f638afa9f7c665cc16e4262e6899 (patch)
tree1e44e67d1133e08943977fb5a85abd3be1a53ed0 /src/usr/local/www/pkg_mgr_install.php
parentdd6c64d81585c76d9c363e867f07c6ff5b3bc06a (diff)
downloadpfsense-18295ff2f907f638afa9f7c665cc16e4262e6899.zip
pfsense-18295ff2f907f638afa9f7c665cc16e4262e6899.tar.gz
Restored countdown functionality and menu refresh on successful update/remove/install
Added comments to clarify operation of the page
Diffstat (limited to 'src/usr/local/www/pkg_mgr_install.php')
-rw-r--r--src/usr/local/www/pkg_mgr_install.php28
1 files changed, 23 insertions, 5 deletions
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php
index fe683b5..0c97e3d 100644
--- a/src/usr/local/www/pkg_mgr_install.php
+++ b/src/usr/local/www/pkg_mgr_install.php
@@ -221,6 +221,7 @@ function waitfor_string_in_file($filename, $string, $timeout) {
}
$pkgmode = '';
+
if (!empty($_REQUEST['mode'])) {
$valid_modes = array(
'reinstallall',
@@ -237,14 +238,18 @@ if (!empty($_REQUEST['mode'])) {
$pkgmode = $_REQUEST['mode'];
}
+// After a successful installation/removal/update the page is reloaded so that any menu changes show up
+// immediately. These values passed as POST arguments tell the page the state it was in before the reload.
$confirmed = isset($_POST['confirmed']) && $_POST['confirmed'] == 'true';
$completed = isset($_POST['completed']) && $_POST['completed'] == 'true';
+$reboot_needed = isset($_POST['reboot_needed']) && $_POST['reboot_needed'] == "yes";
if (!empty($_REQUEST['id'])) {
if ($_REQUEST['id'] != "firmware") {
header("Location: pkg_mgr_installed.php");
return;
}
+
$firmwareupdate = true;
} elseif (!$completed && empty($_REQUEST['pkg']) && $pkgmode != 'reinstallall') {
header("Location: pkg_mgr_installed.php");
@@ -512,7 +517,10 @@ $sysmessage = gettext("Status");
// that were installed
if ($completed):
unlink_if_exists($logfilename . ".json");
- if (($firmwareupdate) && ($_POST['reboot_needed'] == "yes")):
+
+ // If this was a firmware update and a reboot was initiated, display the "Rebooting" message
+ // and start hte countdown timer
+ if ($firmwareupdate && $reboot_needed):
?>
<script>
@@ -676,14 +684,15 @@ function getLogsStatus() {
show_success();
repeat = false;
+ // The package has been installed/removed successfully but any menu changes that result will not be visible
+ // Reloading the page will cause the menu items to be visible and setting reboot_needed will tell the page
+ // that the firewall needs to be rebooted if required.
+
if (json.reboot_needed == "yes") {
$('#reboot_needed').val("yes");
}
- setProgress('progressbar', 100, false);
- $('#progressbar').addClass("progress-bar-success");
- show_success();
- setTimeout(scrollToBottom, 200);
+ $('form').submit();
}
if ((json.pid == "stopped") && ((progress != 0) || (json.exitstatus != 0))) {
@@ -740,6 +749,15 @@ events.push(function() {
show_info();
}
+ // If we are just re-drawing the page after a successful install/remove/reinstall,
+ // we only need to re-populate the progress indicator and the status banner
+ if ("<?=$completed?>") {
+ setProgress('progressbar', 100, false);
+ $('#progressbar').addClass("progress-bar-success");
+ show_success();
+ setTimeout(scrollToBottom, 200);
+ }
+
if ("<?=$firmwareupdate?>") {
get_firmware_versions();
}
OpenPOWER on IntegriCloud