diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-10-21 08:59:11 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-10-21 08:59:11 -0400 |
commit | 141462faf292b6ab5e0e87191e299f6bd59fb79c (patch) | |
tree | a6d7461718acad7b2afbdfda3974785ecd2a2862 | |
parent | 2d12da9581edf748e27815776a28247af49ed467 (diff) | |
download | pfsense-141462faf292b6ab5e0e87191e299f6bd59fb79c.zip pfsense-141462faf292b6ab5e0e87191e299f6bd59fb79c.tar.gz |
Revision of pkg mgr messages and appearance
-rw-r--r-- | src/usr/local/www/pkg_mgr_install.php | 45 | ||||
-rw-r--r-- | src/usr/local/www/pkg_mgr_installed.php | 10 |
2 files changed, 36 insertions, 19 deletions
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php index aaf8a73..0f937ad 100644 --- a/src/usr/local/www/pkg_mgr_install.php +++ b/src/usr/local/www/pkg_mgr_install.php @@ -85,12 +85,11 @@ $start_polling = false; //--------------------------------------------------------------------------------------------------------------------- // After an installation or removal has been started (mwexec(/usr/local/sbin/pfSense-upgrade-GUI.sh . . . )) AJAX calls // are made to get status. -// The log file is read, the newest progress record retrieved, and the PID status obtained. The data is formatted +// The log file is read and the newest progress record retrieved. The data is formatted // as JSON before being returned to the AJAX caller (at the bottom of this file) // // Arguments received here: // logfilename = Passed to installation script to tell it how to name the log file we will parse -// pid = PID of the background install/remove process // next_log_line = Send log file entries that come after this line number // // JSON items returned @@ -203,6 +202,7 @@ function waitfor_string_in_file($filename, $string, $timeout) { fclose($testfile); } + usleep(100000); $now = time(); } @@ -210,6 +210,8 @@ function waitfor_string_in_file($filename, $string, $timeout) { return(false); } +$headline = "<br />"; + if ($_POST) { if (empty($_POST['id']) && $_POST['mode'] != 'reinstallall') { header("Location: pkg_mgr_installed.php"); @@ -220,29 +222,36 @@ if ($_POST) { header("Location: pkg_mgr_installed.php"); return; } -} else if ($_GET) { +} else if ($_GET && !$_GET['id']) { + if (empty($_GET['pkg'])) { + header("Location: pkg_mgr_installed.php"); + return; + } + switch ($_GET['mode']) { case 'reinstallall': + $headline = gettext("Reinstall all packages"); case 'showlog': break; case 'installedinfo': case 'reinstallpkg': - case 'delete': - if (empty($_GET['pkg'])) { - header("Location: pkg_mgr_installed.php"); - return; + if($_GET['from'] && $_GET['from']) { + $headline = gettext("Upgrade package"); + } else { + $headline = gettext("Reinstall package"); } + + break; + case 'delete': + $headline = gettext("Remove package"); break; default: - if (empty($_GET['id'])) { - header("Location: pkg_mgr_installed.php"); - return; - } + $headline = gettext("Install package"); break; } } -$pgtitle = array(gettext("System"),gettext("Package Manager"),gettext("Install Package")); +$pgtitle = array(gettext("System"),gettext("Package Manager"), $headline); include("head.inc"); $tab_array = array(); @@ -253,7 +262,7 @@ display_top_tabs($tab_array); ?> <form action="pkg_mgr_install.php" method="post" class="form-horizontal"> - <h2>Install / remove package</h2> +<!-- <h2><?=$headline?></h2> --> <?php if ((empty($_GET['mode']) && $_GET['id']) || (!empty($_GET['mode']) && (!empty($_GET['pkg']) || $_GET['mode'] == 'reinstallall') && ($_GET['mode'] != 'installedinfo' && $_GET['mode'] != 'showlog'))): if (empty($_GET['mode']) && $_GET['id']) { $pkgname = str_replace(array("<", ">", ";", "&", "'", '"', '.', '/'), "", htmlspecialchars_decode($_GET['id'], ENT_QUOTES | ENT_HTML401)); @@ -277,14 +286,19 @@ display_top_tabs($tab_array); break; } ?> + <br /> <div class="panel panel-default"> - <div class="panel-body"> + <div class="panel-heading"> <div class="content"> <?php if ($pkgmode == 'reinstallall') { ?> <p><?=gettext("All packages will be reinstalled.");?></p> <?php + } else if ($_GET['from'] && $_GET['from']) { +?> + <p>Package: <b><?=$pkgname;?></b> will be upgraded from <b><?=$_GET['from']?></b> to <b><?=$_GET['to']?></b>.</p> +<?php } else { ?> <p>Package: <b><?=$pkgname;?></b> will be <?=$pkgtxt;?>.</p> @@ -293,7 +307,8 @@ display_top_tabs($tab_array); ?> </div> </div> - <div class="panel-footer"> + <div class="panel-body"> + <br /> <input type="hidden" name="id" value="<?=$pkgname;?>" /> <input type="hidden" name="mode" value="<?=$pkgmode;?>" /> <input type="submit" class="btn btn-success" name="pkgconfirm" id="pkgconfirm" value="Confirm"/> diff --git a/src/usr/local/www/pkg_mgr_installed.php b/src/usr/local/www/pkg_mgr_installed.php index a652ba6..0141a33 100644 --- a/src/usr/local/www/pkg_mgr_installed.php +++ b/src/usr/local/www/pkg_mgr_installed.php @@ -54,7 +54,7 @@ * */ /* - pfSense_MODULE: pkgs + pfSense_MODULE: pkgs */ ##|+PRIV @@ -135,6 +135,7 @@ if(empty($installed_packages)):?> #check package version $txtcolor = "black"; $upgradeavail = false; + $vergetstr = ""; if (isset($pkg['installed_version']) && isset($pkg['version'])) { $version_compare = pkg_version_compare($pkg['installed_version'], $pkg['version']); @@ -148,6 +149,7 @@ if(empty($installed_packages)):?> $statusicon = 'refresh'; $txtcolor = "blue"; $upgradeavail = true; + $vergetstr = '&from=' . $pkg['installed_version'] . '&to=' . $pkg['version']; } else if ($version_compare == '=') { // we're running the current version $status = 'Up-to-date'; @@ -167,10 +169,10 @@ if(empty($installed_packages)):?> <tr> <td> <?php if($upgradeavail) { ?> - <a title="<?=$status?>" href="pkg_mgr_install.php?mode=reinstallpkg&pkg=<?=$pkg['name']?>" class="icon-large icon-refresh"></a> + <a title="<?=$status?>" href="pkg_mgr_install.php?mode=reinstallpkg&pkg=<?=$pkg['name']?><?=$vergetstr?>" class="icon-large icon-refresh"></a> <?php } else { ?> <i title="<?=$status?>" class="icon-large icon-ok"></i> -<?php } ?> +<?php } ?> </td> <td> <font color="<?=$txtcolor?>"><?=$shortname?></font> @@ -191,7 +193,7 @@ if(empty($installed_packages)):?> <td> <a title="<?=gettext("Remove")?>" href="pkg_mgr_install.php?mode=delete&pkg=<?=$pkg['name']?>" class="icon-large icon-minus-sign"></a> <?php if($upgradeavail) { ?> - <a title="<?=gettext("Update")?>" href="pkg_mgr_install.php?mode=reinstallpkg&pkg=<?=$pkg['name']?>" class="icon-large icon-refresh"></a> + <a title="<?=gettext("Update")?>" href="pkg_mgr_install.php?mode=reinstallpkg&pkg=<?=$pkg['name']?><?=$vergetstr?>" class="icon-large icon-refresh"></a> <?php } else { ?> <a title="<?=gettext("Reinstall")?>" href="pkg_mgr_install.php?mode=reinstallpkg&pkg=<?=$pkg['name']?>" class="icon-large icon-retweet"></a> <?php } ?> |