Commit 4a2943f7 authored by Franco Fichtner's avatar Franco Fichtner

diagnostics: merge reworked firewall pages from master

parent 9033011d
...@@ -29,68 +29,73 @@ ...@@ -29,68 +29,73 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
$pgtitle = gettext("Diagnostics: pfInfo"); $pgtitle = gettext("Diagnostics: pfInfo");
$data_tabs = array("info", "memory", "timeouts", "interfaces");
if($_REQUEST['getactivity']) {
$text = `/sbin/pfctl -vvsi`; if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$text .= "<p/>"; if (isset($_POST['getactivity'])) {
$text .= `/sbin/pfctl -vvsm`; $diag = configd_run("filter diag info json");
$text .= "<p/>"; echo $diag;
$text .= `/sbin/pfctl -vvst`; }
$text .= "<p/>"; exit;
$text .= `/sbin/pfctl -vvsI`;
echo $text;
exit;
} }
include("head.inc"); include("head.inc");
?> ?>
<body> <body>
<?php include("fbegin.inc"); ?> <?php include("fbegin.inc"); ?>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function() {setTimeout('getpfinfo()', 500);}); $( document ).ready(function() {
//<![CDATA[ function getpfinfo() {
function getpfinfo() { jQuery.ajax({
jQuery.ajax({ type: "post",
type: "POST", url: "/diag_pf_info.php",
url: "/diag_pf_info.php", data: 'getactivity=yes',
data: 'getactivity=yes', dataType: "json",
async: false, success: function(data) {
complete: activitycallback // push data into tabs
}); $.each(data, function(key, value) {
} if ($("#data_"+key.toLowerCase()).length) {
function activitycallback(transport) { $("#data_"+key.toLowerCase()).html(value);
jQuery('#pfactivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText + '<\/pre><\/font>'); }
setTimeout('getpfinfo()', 2000); });
} setTimeout(getpfinfo, 2000);
//]]> }
});
}
getpfinfo();
});
</script> </script>
<section class="page-content-main"> <section class="page-content-main">
<div class="container-fluid col-xs-12 col-sm-10 col-md-9"> <div class="container-fluid col-xs-12">
<div class="row"> <div class="row">
<section class="col-xs-12"> <section class="col-xs-12">
<ul class="nav nav-tabs" data-tabs="tabs" id="maintabs">
<?php
<?php foreach($data_tabs as $i => $tabname):?>
if($savemsg) { <li <?= $i == 0 ? 'class="active"' : '';?>>
echo "<div id=\"savemsg\">"; <a data-toggle="tab" href="#<?=$tabname;?>" id="<?=$tabname;?>_tab">
print_info_box($savemsg); <?=ucfirst($tabname);?>
echo "</div>"; </a>
} </li>
if (isset($input_errors) && count($input_errors) > 0) <?php
print_input_errors($input_errors); endforeach;?>
?> </ul>
<div class="tab-content content-box tab-content">
<div id="pfactivitydiv"> <?php
<?=gettext("Gathering PF information, please wait...");?> foreach($data_tabs as $i => $tabname):?>
</div> <div id="<?=$tabname;?>" class="tab-pane fade in <?= $i == 0 ? 'active' : '';?>">
<div class="container-fluid">
</section> <pre id="data_<?=$tabname;?>" class="pre-scrollable" >
</div> <?=gettext("Gathering PF information, please wait...");?>
</div> </pre>
</div>
</div>
<?php
endforeach;?>
</div>
</section>
</div>
</div>
</section> </section>
<?php include("foot.inc"); ?> <?php include("foot.inc"); ?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment