Project

General

Profile

Download (3.41 KB) Statistics
| Branch: | Tag: | Revision:
1 9242ba15 Scott Ullrich
<?php
2
/* $Id$ */
3
/*
4
    diag_limiter_info.php
5
    Copyright (C) 2010 Scott Ullrich
6 ed2d1343 Renato Botelho
    Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7 9242ba15 Scott Ullrich
    All rights reserved.
8
9
    Redistribution and use in source and binary forms, with or without
10
    modification, are permitted provided that the following conditions are met:
11
12
    1. Redistributions of source code must retain the above copyright notice,
13
       this list of conditions and the following disclaimer.
14
15
    2. Redistributions in binary form must reproduce the above copyright
16
       notice, this list of conditions and the following disclaimer in the
17
       documentation and/or other materials provided with the distribution.
18
19
    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
    AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
    AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
    POSSIBILITY OF SUCH DAMAGE.
29
*/
30
31
/*
32
	pfSense_BUILDER_BINARIES:	/usr/bin/top
33
	pfSense_MODULE:	system
34
*/
35
36
##|+PRIV
37 7997ed44 Renato Botelho
##|*IDENT=page-diagnostics-limiter-info
38
##|*NAME=Diagnostics: Limiter Info
39
##|*DESCR=Allows access to the 'Diagnostics: Limiter Info' page
40
##|*MATCH=diag_limiter_info.php*
41 9242ba15 Scott Ullrich
##|-PRIV
42
43
require("guiconfig.inc");
44
45
$pgtitle = gettext("Diagnostics: Limiter Info");
46 d71fc5d3 jim-p
$shortcut_section = "trafficshaper-limiters";
47 9242ba15 Scott Ullrich
48
if($_REQUEST['getactivity']) {
49
	$text = `/sbin/ipfw pipe show`;
50
	if($text == "") 
51
		$text = "We could not find any limiters on this system.";
52 f8707b15 jim-p
	echo "Limiters:\n";
53 9242ba15 Scott Ullrich
	echo $text;
54 f8707b15 jim-p
	$text = `/sbin/ipfw queue show`;
55
	if($text != "") {
56
		echo "\n\nQueues:\n";
57
		echo $text;
58
	}
59 9242ba15 Scott Ullrich
	exit;
60
}
61
62
include("head.inc");
63
64
?>
65
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
66 9610936a Colin Fleming
<?php include("fbegin.inc"); ?>
67 9242ba15 Scott Ullrich
<script type="text/javascript">
68 9610936a Colin Fleming
//<![CDATA[
69 9242ba15 Scott Ullrich
	function getlimiteractivity() {
70
		var url = "/diag_limiter_info.php";
71
		var pars = 'getactivity=yes';
72 ebfc87d6 Vinicius Coque
		jQuery.ajax(
73 9242ba15 Scott Ullrich
			url,
74
			{
75 ebfc87d6 Vinicius Coque
				type: 'post',
76
				data: pars,
77
				complete: activitycallback
78 9242ba15 Scott Ullrich
			});
79
	}
80
	function activitycallback(transport) {
81 9610936a Colin Fleming
		jQuery('#limiteractivitydiv').html('<font face="Courier" size="2"><pre style="text-align:left;">' + transport.responseText  + '<\/pre><\/font>');
82
		setTimeout('getlimiteractivity()', 2000);
83 9242ba15 Scott Ullrich
	}
84 9610936a Colin Fleming
	setTimeout('getlimiteractivity()', 5000);
85
//]]>
86 9242ba15 Scott Ullrich
</script>
87 9610936a Colin Fleming
<div id="maincontent">
88 9242ba15 Scott Ullrich
<?php
89
	if($savemsg) {
90 9610936a Colin Fleming
		echo "<div id=\"savemsg\">";
91 9242ba15 Scott Ullrich
		print_info_box($savemsg);
92
		echo "</div>";	
93
	}
94
	if ($input_errors)
95
		print_input_errors($input_errors);
96
?>
97 9610936a Colin Fleming
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="diag limiter info">
98 9242ba15 Scott Ullrich
  <tr>
99
    <td>
100 9610936a Colin Fleming
	<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
101 9242ba15 Scott Ullrich
		<tr>
102 9610936a Colin Fleming
			<td align="center">
103
				<table summary="results">
104 9242ba15 Scott Ullrich
					<tr><td>
105 9610936a Colin Fleming
						<div id="limiteractivitydiv">
106
							<?=gettext("Gathering Limiter information, please wait...");?>
107 9242ba15 Scott Ullrich
						</div>
108
					</td></tr>
109
				</table>
110
			</td>
111
		</tr>
112
	</table>
113
    </td>
114
  </tr>
115
</table>
116 9610936a Colin Fleming
</div>
117 9242ba15 Scott Ullrich
<?php include("fend.inc"); ?>
118
</body>
119
</html>