Projet

Général

Profil

« Précédent | Suivant » 

Révision 4d33138f

Ajouté par Colin Fleming il y a presque 10 ans

Tidy up "status_openvpn.php" XHTML

Add CDATA sections to SCRIPTS
Add SUMMARY to TABLES
Change NAME to ID in TR tags
Closing IMG tags and add ALT to IMG
Add missing closing FORM, closing BODY and closing HTML

Voir les différences:

usr/local/www/status_openvpn.php
111 111
<?php include("fbegin.inc"); ?>
112 112
<form action="status_openvpn.php" method="get" name="iform">
113 113
<script type="text/javascript">
114
//<![CDATA[
114 115
	function killClient(mport, remipp) {
115 116
		var busy = function(index,icon) {
116 117
			jQuery(icon).bind("onclick","");
......
138 139
			function(index,row) { jQuery(row).fadeOut(1000); }
139 140
		);
140 141
	}
142
//]]>
141 143
</script>
142 144
<?php $i = 0; ?>
143 145
<?php foreach ($servers as $server): ?>
144 146

  
145
<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0">
147
<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0" summary="status openvpn">
146 148
	<tr>
147 149
		<td colspan="6" class="listtopic">
148 150
			<?=$server['name'];?> <?=gettext("Client connections"); ?>
......
150 152
	</tr>
151 153
	<tr>
152 154
		<td>
153
			<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
155
			<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="connections">
154 156
			<tr>
155 157
				<td class="listhdrr"><?=gettext("Common Name"); ?></td>
156 158
				<td class="listhdrr"><?=gettext("Real Address"); ?></td>
......
161 163
			</tr>
162 164

  
163 165
			<?php foreach ($server['conns'] as $conn): ?>
164
			<tr name='<?php echo "r:{$server['mgmt']}:{$conn['remote_host']}"; ?>'>
166
			<tr id="<?php echo "r:{$server['mgmt']}:{$conn['remote_host']}"; ?>">
165 167
				<td class="listlr">
166 168
					<?=$conn['common_name'];?>
167 169
				</td>
......
180 182
				<td class="listr">
181 183
					<?=$conn['bytes_recv'];?>
182 184
				</td>
183
				<td class='list'>
184
					<img src='/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif' height='17' width='17' border='0'
185
					   onclick="killClient('<?php echo $server['mgmt']; ?>', '<?php echo $conn['remote_host']; ?>');" style='cursor:pointer;'
186
					   name='<?php echo "i:{$server['mgmt']}:{$conn['remote_host']}"; ?>'
187
					   title='<?php echo gettext("Kill client connection from") . ' ' . $conn['remote_host']; ?>' alt='' />
185
				<td class="list">
186
					<img src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_x.gif" height="17" width="17" border="0"
187
					   onclick="killClient('<?php echo $server['mgmt']; ?>', '<?php echo $conn['remote_host']; ?>');" style="cursor:pointer;"
188
					   id="<?php echo "i:{$server['mgmt']}:{$conn['remote_host']}"; ?>"
189
					   title="<?php echo gettext("Kill client connection from") . " " . $conn['remote_host']; ?>" alt="delete" />
188 190
				</td>
189 191
			</tr>
190 192

  
......
194 196
				<td colspan="2" class="list" height="12">
195 197
				<table>
196 198
				<tr>
197
				<?php $ssvc = find_service_by_openvpn_vpnid($server['vpnid']); ?>
199
				<td><?php $ssvc = find_service_by_openvpn_vpnid($server['vpnid']); ?>
198 200
				<?= get_service_status_icon($ssvc, true, true); ?>
199
				<td><?= get_service_control_links($ssvc, true); ?></td>
201
				<?= get_service_control_links($ssvc, true); ?></td>
200 202
				</tr>
201 203
				</table>
202 204
				</td>
......
209 211
</table>
210 212
<?php if (is_array($server['routes']) && count($server['routes'])): ?>
211 213
<div id="shroutebut-<?= $i ?>">
212
<input type="button" onClick="show_routes('tabroute-<?= $i ?>','shroutebut-<?= $i ?>')" value="<?php echo gettext("Show Routing Table"); ?>" /> - <?= gettext("Display OpenVPN's internal routing table for this server.") ?></a>
214
<input type="button" onClick="show_routes('tabroute-<?= $i ?>','shroutebut-<?= $i ?>')" value="<?php echo gettext("Show Routing Table"); ?>" /> - <?= gettext("Display OpenVPN's internal routing table for this server.") ?>
213 215
<br /><br />
214 216
</div>
215
<table style="display: none; padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0" id="tabroute-<?= $i ?>">
217
<table style="display: none; padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0" id="tabroute-<?= $i ?>" summary="routing table">
216 218
	<tr>
217 219
		<td colspan="6" class="listtopic">
218 220
			<?=$server['name'];?> <?=gettext("Routing Table"); ?>
......
220 222
	</tr>
221 223
	<tr>
222 224
		<td>
223
			<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
225
			<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="results">
224 226
			<tr>
225 227
				<td class="listhdrr"><?=gettext("Common Name"); ?></td>
226 228
				<td class="listhdrr"><?=gettext("Real Address"); ?></td>
......
229 231
			</tr>
230 232

  
231 233
			<?php foreach ($server['routes'] as $conn): ?>
232
			<tr name='<?php echo "r:{$server['mgmt']}:{$conn['remote_host']}"; ?>'>
234
			<tr id="<?php echo "r:{$server['mgmt']}:{$conn['remote_host']}"; ?>">
233 235
				<td class="listlr">
234 236
					<?=$conn['common_name'];?>
235 237
				</td>
......
261 263
<br />
262 264

  
263 265
<?php if (!empty($sk_servers)) { ?>
264
<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0">
266
<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0" summary="peer to peer stats">
265 267
	<tr>
266 268
		<td colspan="6" class="listtopic">
267 269
			<?=gettext("Peer to Peer Server Instance Statistics"); ?>
......
269 271
	</tr>
270 272
	<tr>
271 273
		<td>
272
			<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
274
			<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="results">
273 275
			<tr>
274 276
				<td class="listhdrr"><?=gettext("Name"); ?></td>
275 277
				<td class="listhdrr"><?=gettext("Status"); ?></td>
......
282 284
			</tr>
283 285

  
284 286
<?php foreach ($sk_servers as $sk_server): ?>
285
			<tr name='<?php echo "r:{$sk_server['port']}:{$sk_server['vpnid']}"; ?>'>
287
			<tr id="<?php echo "r:{$sk_server['port']}:{$sk_server['vpnid']}"; ?>">
286 288
				<td class="listlr">
287 289
					<?=$sk_server['name'];?>
288 290
				</td>
......
307 309
				<td class="listr">
308 310
				<table>
309 311
				<tr>
310
				<?php $ssvc = find_service_by_openvpn_vpnid($sk_server['vpnid']); ?>
312
				<td><?php $ssvc = find_service_by_openvpn_vpnid($sk_server['vpnid']); ?>
311 313
				<?= get_service_status_icon($ssvc, false, true); ?>
312
				<td><?= get_service_control_links($ssvc, true); ?></td>
314
				<?= get_service_control_links($ssvc, true); ?></td>
313 315
				</tr>
314 316
				</table>
315 317
				</td>
......
324 326
} ?>
325 327
<br />
326 328
<?php if (!empty($clients)) { ?>
327
<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0">
329
<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" width="100%" border="0" cellpadding="0" cellspacing="0" summary="client stats">
328 330
	<tr>
329 331
		<td colspan="6" class="listtopic">
330 332
			<?=gettext("Client Instance Statistics"); ?>
......
332 334
	</tr>
333 335
	<tr>
334 336
		<td>
335
			<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
337
			<table style="padding-top:0px; padding-bottom:0px; padding-left:0px; padding-right:0px" class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="results">
336 338
			<tr>
337 339
				<td class="listhdrr"><?=gettext("Name"); ?></td>
338 340
				<td class="listhdrr"><?=gettext("Status"); ?></td>
......
345 347
			</tr>
346 348

  
347 349
<?php foreach ($clients as $client): ?>
348
			<tr name='<?php echo "r:{$client['port']}:{$client['vpnid']}"; ?>'>
350
			<tr id="<?php echo "r:{$client['port']}:{$client['vpnid']}"; ?>">
349 351
				<td class="listlr">
350 352
					<?=$client['name'];?>
351 353
				</td>
......
370 372
				<td class="listr" height="12">
371 373
				<table>
372 374
				<tr>
373
				<?php $ssvc = find_service_by_openvpn_vpnid($client['vpnid']); ?>
375
				<td><?php $ssvc = find_service_by_openvpn_vpnid($client['vpnid']); ?>
374 376
				<?= get_service_status_icon($ssvc, false, true); ?>
375
				<td><?= get_service_control_links($ssvc, true); ?></td>
377
				<?= get_service_control_links($ssvc, true); ?></td>
376 378
				</tr>
377 379
				</table>
378 380
				</td>
......
382 384
		</td>
383 385
	</tr>
384 386
</table>
387
</form>
385 388

  
386 389
<?php 
387 390
}
......
398 401

  
399 402
<?php include("fend.inc"); ?>
400 403
<script type="text/javascript">
404
//<![CDATA[
401 405
function show_routes(id, buttonid) {
402 406
	document.getElementById(buttonid).innerHTML='';
403 407
	aodiv = document.getElementById(id);
404 408
	aodiv.style.display = "block";
405 409
}
410
//]]>
406 411
</script>
412
</body>
413
</html>

Formats disponibles : Unified diff