Project

General

Profile

« Previous | Next » 

Revision f7c1bce7

Added by sbeaver over 10 years ago

Updated to bootstrap

Use of Ajax in this file precluded the use of Form.classes

Table was replaced with bootstrap panel/row and input component classes
updated.

View differences:

usr/local/www/diag_system_pftop.php
1 1
<?php
2 2
/* $Id$ */
3 3
/*
4
    diag_system_pftop.php
5
    Copyright (C) 2008-2009 Scott Ullrich
6
    Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7
    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.
4
	diag_system_pftop.php
5
	Copyright (C) 2008-2009 Scott Ullrich
6
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
7
	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 29
*/
30 30

  
31 31
/*
......
91 91
}
92 92

  
93 93
?>
94
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
95
<?php include("fbegin.inc"); ?>
94

  
96 95
<form method="post" action="diag_system_pftop.php">
97 96
<script type="text/javascript">
98 97
//<![CDATA[
......
114 113
	setTimeout('getpftopactivity()', 1000);
115 114
//]]>
116 115
</script>
117
<div id="maincontent">
116

  
117

  
118 118
<?php
119 119
	if($savemsg) {
120 120
		echo "<div id=\"savemsg\">";
121 121
		print_info_box($savemsg);
122 122
		echo "</div>";	
123 123
	}
124
	
124 125
	if ($input_errors)
125 126
		print_input_errors($input_errors);
126 127
?>
127
		<div id="mainarea" style="padding-bottom: 0px;">
128
		<table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0" summary="diag system pftop">
129
			<tr>
130
				<td class="list">
131
					<div id='viewtypediv'><?=gettext("View type:"); ?>
132
						<select name='viewtype' id='viewtype'>
133
							<option value='default' <?php echo ($viewtype == "default") ? "selected=\"selected\"" : ""; ?>><?=gettext("Default");?></option>
134
							<option value='label' <?php echo ($viewtype == "label") ? "selected=\"selected\"" : ""; ?>><?=gettext("Label");?></option>
135
							<option value='long' <?php echo ($viewtype == "long") ? "selected=\"selected\"" : ""; ?>><?=gettext("Long");?></option>
136
							<option value='queue' <?php echo ($viewtype == "queue") ? "selected=\"selected\"" : ""; ?>><?=gettext("Queue");?></option>
137
							<option value='rules' <?php echo ($viewtype == "rules") ? "selected=\"selected\"" : ""; ?>><?=gettext("Rules");?></option>
138
							<option value='size' <?php echo ($viewtype == "size") ? "selected=\"selected\"" : ""; ?>><?=gettext("Size");?></option>
139
							<option value='speed' <?php echo ($viewtype == "speed") ? "selected=\"selected\"" : ""; ?>><?=gettext("Speed");?></option>
140
							<option value='state' <?php echo ($viewtype == "state") ? "selected=\"selected\"" : ""; ?>><?=gettext("State");?></option>
141
							<option value='time' <?php echo ($viewtype == "time") ? "selected=\"selected\"" : ""; ?>><?=gettext("Time");?></option>
142
						</select>
143
					</div>
144
				</td>
145
				<td class="list">
146
					<div id='sorttypediv'><?=gettext("Sort type:"); ?>
147
						<select name='sorttype' id='sorttype'>
148
							<option value='age' <?php echo ($sorttype == "age") ? "selected=\"selected\"" : ""; ?>><?=gettext("Age");?></option>
149
							<option value='bytes' <?php echo ($sorttype == "bytes") ? "selected=\"selected\"" : ""; ?>><?=gettext("Bytes");?></option>
150
							<option value='dest' <?php echo ($sorttype == "dest") ? "selected=\"selected\"" : ""; ?>><?=gettext("Destination Address");?></option>
151
							<option value='dport' <?php echo ($sorttype == "dport") ? "selected=\"selected\"" : ""; ?>><?=gettext("Destination Port");?></option>
152
							<option value='exp' <?php echo ($sorttype == "exp") ? "selected=\"selected\"" : ""; ?>><?=gettext("Expiry");?></option>
153
							<option value='none' <?php echo ($sorttype == "none") ? "selected=\"selected\"" : ""; ?>><?=gettext("None");?></option>
154
							<option value='peak' <?php echo ($sorttype == "peak") ? "selected=\"selected\"" : ""; ?>><?=gettext("Peak");?></option>
155
							<option value='pkt' <?php echo ($sorttype == "pkt") ? "selected=\"selected\"" : ""; ?>><?=gettext("Packet");?></option>
156
							<option value='rate' <?php echo ($sorttype == "rate") ? "selected=\"selected\"" : ""; ?>><?=gettext("Rate");?></option>
157
							<option value='size' <?php echo ($sorttype == "size") ? "selected=\"selected\"" : ""; ?>><?=gettext("Size");?></option>
158
							<option value='sport' <?php echo ($sorttype == "sport") ? "selected=\"selected\"" : ""; ?>><?=gettext("Source Port");?></option>
159
							<option value='src' <?php echo ($sorttype == "src") ? "selected=\"selected\"" : ""; ?>><?=gettext("Source Address");?></option>
160
						</select>
161
					</div>
162
				</td>
163
				<td class="list">
164
					<div id='statesdiv'><?=gettext("Number of States:"); ?>
165
						<select name='states' id='states'>
166
							<option value='50' <?php echo ($numstate == "50") ? "selected=\"selected\"" : ""; ?>>50</option>
167
							<option value='100' <?php echo ($numstate == "100") ? "selected=\"selected\"" : ""; ?>>100</option>
168
							<option value='200' <?php echo ($numstate == "200") ? "selected=\"selected\"" : ""; ?>>200</option>
169
							<option value='500' <?php echo ($numstate == "500") ? "selected=\"selected\"" : ""; ?>>500</option>
170
							<option value='1000' <?php echo ($numstate == "1000") ? "selected=\"selected\"" : ""; ?>>1000</option>
171
							<option value='all' <?php echo ($numstate == "all") ? "selected=\"selected\"" : ""; ?>>all</option>
172
						</select>
173
					</div>
174
				</td>
175
			</tr>
176
			<tr>
177
				<td colspan="3" align="center">
178
					<table id="backuptable" class="tabcont" align="center" width="100%" border="0" cellpadding="6" cellspacing="0" summary="tabcont">
179
						<tr>
180
							<td align="center">
181
									<table summary="results">
182
										<tr>
183
											<td>
184
												<div id="pftopactivitydiv"><?=gettext("Gathering pfTOP activity, please wait...");?></div>
185
											</td>
186
										</tr>
187
									</table>
188
							</td>
189
						</tr>
190
					</table>
191
				</td>
192
		  </tr>
193
		</table>
194
	</div>
195
</div>
128
    
129
	<div class="panel panel-default">
130
        <div class="row">
131
			<div class="form-group col-sm-2" id='viewtypediv'><?=gettext("View type:"); ?>
132
				<select  class="form-control col-sm-2" name='viewtype' id='viewtype'>
133
					<option value='default' <?=($viewtype == "default") ? "selected=\"selected\"" : ""; ?>><?=gettext("Default")?></option>
134
					<option value='label' <?=($viewtype == "label") ? "selected=\"selected\"" : ""; ?>><?=gettext("Label")?></option>
135
					<option value='long' <?=($viewtype == "long") ? "selected=\"selected\"" : ""; ?>><?=gettext("Long")?></option>
136
					<option value='queue' <?=($viewtype == "queue") ? "selected=\"selected\"" : ""; ?>><?=gettext("Queue")?></option>
137
					<option value='rules' <?=($viewtype == "rules") ? "selected=\"selected\"" : ""; ?>><?=gettext("Rules")?></option>
138
					<option value='size' <?=($viewtype == "size") ? "selected=\"selected\"" : ""; ?>><?=gettext("Size")?></option>
139
					<option value='speed' <?=($viewtype == "speed") ? "selected=\"selected\"" : ""; ?>><?=gettext("Speed")?></option>
140
					<option value='state' <?=($viewtype == "state") ? "selected=\"selected\"" : ""; ?>><?=gettext("State")?></option>
141
					<option value='time' <?=($viewtype == "time") ? "selected=\"selected\"" : ""; ?>><?=gettext("Time")?></option>
142
				</select>
143
			</div>
144
		    <div class="form-group col-sm-2" id='sorttypediv'><?=gettext("Sort type:"); ?>
145
				<select class="form-control col-sm-2" name='sorttype' id='sorttype'>
146
					<option value='age' <?=($sorttype == "age") ? "selected=\"selected\"" : ""; ?>><?=gettext("Age")?></option>
147
					<option value='bytes' <?=($sorttype == "bytes") ? "selected=\"selected\"" : ""; ?>><?=gettext("Bytes")?></option>
148
					<option value='dest' <?=($sorttype == "dest") ? "selected=\"selected\"" : ""; ?>><?=gettext("Destination Address")?></option>
149
					<option value='dport' <?=($sorttype == "dport") ? "selected=\"selected\"" : ""; ?>><?=gettext("Destination Port")?></option>
150
					<option value='exp' <?=($sorttype == "exp") ? "selected=\"selected\"" : ""; ?>><?=gettext("Expiry")?></option>
151
					<option value='none' <?=($sorttype == "none") ? "selected=\"selected\"" : ""; ?>><?=gettext("None")?></option>
152
					<option value='peak' <?=($sorttype == "peak") ? "selected=\"selected\"" : ""; ?>><?=gettext("Peak")?></option>
153
					<option value='pkt' <?=($sorttype == "pkt") ? "selected=\"selected\"" : ""; ?>><?=gettext("Packet")?></option>
154
					<option value='rate' <?=($sorttype == "rate") ? "selected=\"selected\"" : ""; ?>><?=gettext("Rate")?></option>
155
					<option value='size' <?=($sorttype == "size") ? "selected=\"selected\"" : ""; ?>><?=gettext("Size")?></option>
156
					<option value='sport' <?=($sorttype == "sport") ? "selected=\"selected\"" : ""; ?>><?=gettext("Source Port")?></option>
157
					<option value='src' <?=($sorttype == "src") ? "selected=\"selected\"" : ""; ?>><?=gettext("Source Address")?></option>
158
				</select>
159
			</div>
160
		    <div class="form-group col-sm-2" id='statesdiv'><?=gettext("# of States:"); ?>
161
				<select class="form-control col-sm-2 name=" states' id='states'>
162
					<option value='50' <?=($numstate == "50") ? "selected=\"selected\"" : ""; ?>>50</option>
163
					<option value='100' <?=($numstate == "100") ? "selected=\"selected\"" : ""; ?>>100</option>
164
					<option value='200' <?=($numstate == "200") ? "selected=\"selected\"" : ""; ?>>200</option>
165
					<option value='500' <?=($numstate == "500") ? "selected=\"selected\"" : ""; ?>>500</option>
166
					<option value='1000' <?=($numstate == "1000") ? "selected=\"selected\"" : ""; ?>>1000</option>
167
					<option value='all' <?=($numstate == "all") ? "selected=\"selected\"" : ""; ?>>all</option>
168
				</select>
169
			</div>
170
        </div>
171
    </div>
172

  
173
    <div class="panel panel-default panel-info">
174
        <div class="panel-heading">Output</div>
175
	    <div class="panel panel-body" id="pftopactivitydiv">
176
	        <?=gettext("Gathering pfTOP activity, please wait...")?>
177
	    </div>									
178
    </div>
179
    
180
    </div>
196 181
</form>
197
<?php include("fend.inc"); ?>
182
    
183
<?php include("foot.inc"); ?>
184

  
198 185
<script type="text/javascript">
199 186
//<![CDATA[
200 187
jQuery("#viewtype").change(function() {
......
211 198
});
212 199
//]]>
213 200
</script>
214
</body>
215
</html>

Also available in: Unified diff