summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/usr/local/www/diag_dump_states.php57
-rw-r--r--src/usr/local/www/pkg_mgr_install.php10
2 files changed, 38 insertions, 29 deletions
diff --git a/src/usr/local/www/diag_dump_states.php b/src/usr/local/www/diag_dump_states.php
index 8d77756..5a9ab72 100755
--- a/src/usr/local/www/diag_dump_states.php
+++ b/src/usr/local/www/diag_dump_states.php
@@ -133,7 +133,7 @@ $current_statecount=`pfctl -si | grep "current entries" | awk '{ print $3 }'`;
$form = new Form(false);
-$section = new Form_Section('State filter');
+$section = new Form_Section('State filter', 'secfilter', COLLAPSIBLE|SEC_CLOSED);
$section->addInput(new Form_Input(
'filter',
@@ -162,17 +162,21 @@ if (isset($_POST['filter']) && (is_ipaddr($_POST['filter']) || is_subnet($_POST[
$form->add($section);
print $form;
?>
-<table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
- <thead>
- <tr>
- <th><?=gettext("Interface")?></th>
- <th><?=gettext("Protocol")?></th>
- <th><?=gettext("Source -> Router -> Destination")?></th>
- <th><?=gettext("State")?></th>
- <th></th> <!-- For the optional "Remove" button -->
- </tr>
- </thead>
- <tbody>
+<div class="panel panel-default">
+ <div class="panel-heading"><h2 class="panel-title"><?=gettext("States")?></h2></div>
+ <div class="panel-body">
+ <div class="table-responsive">
+ <table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
+ <thead>
+ <tr>
+ <th><?=gettext("Interface")?></th>
+ <th><?=gettext("Protocol")?></th>
+ <th><?=gettext("Source -> Router -> Destination")?></th>
+ <th><?=gettext("State")?></th>
+ <th></th> <!-- For the optional "Remove" button -->
+ </tr>
+ </thead>
+ <tbody>
<?php
$row = 0;
/* get our states */
@@ -200,21 +204,24 @@ print $form;
$parts = explode(":", $ends[count($ends) - 1]);
$dstip = trim($parts[0]);
?>
- <tr>
- <td><?= $iface ?></td>
- <td><?= $proto ?></td>
- <td><?= $info ?></td>
- <td><?= $state ?></td>
-
- <td>
- <a class="btn fa fa-trash" data-entry="<?=$srcip?>|<?=$dstip?>"
- title="<?=sprintf(gettext('Remove all state entries from %s to %s'), $srcip, $dstip);?>"></a>
- </td>
- </tr>
+ <tr>
+ <td><?= $iface ?></td>
+ <td><?= $proto ?></td>
+ <td><?= $info ?></td>
+ <td><?= $state ?></td>
+
+ <td>
+ <a class="btn fa fa-trash" data-entry="<?=$srcip?>|<?=$dstip?>"
+ title="<?=sprintf(gettext('Remove all state entries from %s to %s'), $srcip, $dstip);?>"></a>
+ </td>
+ </tr>
<?php $row++; }
?>
- </tbody>
-</table>
+ </tbody>
+ </table>
+ </div>
+ </div>
+</div>
<?php
if ($row == 0) {
diff --git a/src/usr/local/www/pkg_mgr_install.php b/src/usr/local/www/pkg_mgr_install.php
index 8bbf4b4..df9c4aa 100644
--- a/src/usr/local/www/pkg_mgr_install.php
+++ b/src/usr/local/www/pkg_mgr_install.php
@@ -123,22 +123,24 @@ if ($_REQUEST['ajax']) {
if ($logfile != FALSE) {
$resparray = array();
$statusarray = array();
+ $code = array();
// Log file is read a line at a time so that we can detect/modify certain entries
while (($logline = fgets($logfile)) !== false) {
// Check for return codes and replace with suitable strings
if (strpos($logline, "_RC=") !== false) {
- $code = str_replace("__RC=", "", $logline);
- $statusarray['reboot_needed'] = (strpos($code, "REBOOT_AFTER") === false) ? "no":"yes";
+ $code = explode(" ", $$logline);
+ $rc = str_replace("__RC=", "", $code[0]);
+ $statusarray['reboot_needed'] = (strpos($code[1], "REBOOT_AFTER") === false) ? "no":"yes";
- if ($code == 0) {
+ if ($rc == 0) {
$logline = gettext("Success") . "\n";
} else {
$logline = gettext("Failed") . "\n";
}
$response .= $logline;
- $statusarray['exitstatus'] = $code;
+ $statusarray['exitstatus'] = $rc;
} else {
$response .= htmlspecialchars($logline);
}
OpenPOWER on IntegriCloud