diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-12-03 12:13:11 -0500 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-12-03 14:22:56 -0500 |
commit | 331e063ccac63574dbf725138b2be30e6f072c23 (patch) | |
tree | 39b4b5306444d65156db3011eb6b4bb386e1b46a /src/usr/local | |
parent | af28e23103b915061d60e94f6416ad47fd0ed1cd (diff) | |
download | pfsense-331e063ccac63574dbf725138b2be30e6f072c23.zip pfsense-331e063ccac63574dbf725138b2be30e6f072c23.tar.gz |
Further changes to Section.class.php and to diag_logs_filter.php
Experimental section collapse
Form_Section() now accepts up to 4 arguments: Form_section(title, id, collapsable, initiall_collapsed)
collapsable = true specifies that the panel should be collapsable and should have a plus/minus icon in the title bar to allow that. Defaults to false
A unique ID is required when collapsable is specified (per page) so we know which panel to collapse
If initially_collapsed is true, the panel starts out collapsed (defaults to false)
Diffstat (limited to 'src/usr/local')
-rw-r--r-- | src/usr/local/www/classes/Form/Section.class.php | 10 | ||||
-rw-r--r-- | src/usr/local/www/diag_logs_filter.php | 35 |
2 files changed, 31 insertions, 14 deletions
diff --git a/src/usr/local/www/classes/Form/Section.class.php b/src/usr/local/www/classes/Form/Section.class.php index d17763e..e012d14 100644 --- a/src/usr/local/www/classes/Form/Section.class.php +++ b/src/usr/local/www/classes/Form/Section.class.php @@ -39,13 +39,14 @@ class Form_Section extends Form_Element protected $_groups = array(); protected $_collapsable; - public function __construct($title, $id = "", $collapsable = false) + public function __construct($title, $id = "", $collapsable = false, $startcollapsed = false) { if (!empty($id)) { $this->_attributes['id'] = $id; } $this->_title = $title; $this->_collapsable = $collapsable; + $this->_startcollapsed = $startcollapsed; } public function add(Form_Group $group) @@ -81,7 +82,12 @@ class Form_Section extends Form_Element '<i class="fa fa-plus-circle"></i>' . '</a>' . '</span>'; - $bodyclass = '<div class="panel-body collapse in">'; + $bodyclass = '<div class="panel-body collapse '; + if ($this->_startcollapsed) { + $bodyclass .= 'out">'; + } else { + $bodyclass .= 'in">'; + } } return <<<EOT diff --git a/src/usr/local/www/diag_logs_filter.php b/src/usr/local/www/diag_logs_filter.php index 7de155a..bc88afe 100644 --- a/src/usr/local/www/diag_logs_filter.php +++ b/src/usr/local/www/diag_logs_filter.php @@ -207,7 +207,7 @@ if ($filterfieldsarray['interface'] == "All") if (!isset($config['syslog']['rawfilter'])) { // Advanced log filter form $form = new Form(false); - $section = new Form_Section('Advanced Log Filter', 'adv-filter-panel', true); + $section = new Form_Section('Advanced Log Filter', 'adv-filter-panel', true, true); $group = new Form_Group(''); @@ -351,6 +351,11 @@ if (!isset($config['syslog']['rawfilter'])) { $filterlog = conv_log_filter($filter_logfile, $nentries, $nentries + 100, $filtertext, $interfacefilter); ?> +<form id="clearform" name="clearform" action="diag_logs_filter.php" method="post" style="margin-top: 14px;"> + <input id="submit" name="clear" type="submit" class="btn btn-danger" value="<?=gettext("Clear log")?>" /> +</form> + +<br /> <div class="panel panel-default"> <div class="panel-heading"> <h2 class="panel-title"> @@ -480,10 +485,22 @@ if (!isset($config['syslog']['rawfilter'])) { else { ?> +<div class="panel panel-default"> + <div class="panel-heading"> + <h2 class="panel-title"> +<?php + + printf(gettext("Last %s firewall log entries."), count($filterlog)); + printf(gettext(" (Maximum %s)"), $nentries); +?> + </h2> + </div> + <div class="panel-body"> + <div class="table-responsive"> + <table class="table table-striped table-hover table-compact"> <tr> - <td colspan="2"> - <?php printf(gettext("Last %s firewall log entries"),$nentries)?> - </td> + <th></th> + <th></th> </tr> <?php if ($filtertext) @@ -497,12 +514,7 @@ else </div> </div> -<p> - <form id="clearform" name="clearform" action="diag_logs_filter.php" method="post" style="margin-top: 14px;"> - <input id="submit" name="clear" type="submit" class="btn btn-danger" value="<?=gettext("Clear log")?>" /> - </form> -</p> - +<div id="infoblock"> <?php print_info_box('<a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F">' . @@ -510,7 +522,7 @@ print_info_box('<a href="https://doc.pfsense.org/index.php/What_are_TCP_Flags%3F '<i class="fa fa-minus-square-o icon-primary"></i> = Add to block list., <i class="fa fa-plus-square-o icon-primary"></i> = Pass traffic, <i class="fa fa-info icon-primary"></i> = Resolve'); ?> - +</div> <!-- AJAXY STUFF --> <script type="text/javascript"> //<![CDATA[ @@ -586,7 +598,6 @@ if (typeof getURL == 'undefined') { events.push(function(){ $('.fa').tooltip(); - }); //]]> </script> |