Revision f3bb71cf
Added by Sjon Hortensius about 10 years ago
usr/local/www/system_routes.php | ||
---|---|---|
201 | 201 |
|
202 | 202 |
include("head.inc"); |
203 | 203 |
|
204 |
?> |
|
205 |
|
|
206 |
<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> |
|
207 |
<?php include("fbegin.inc"); ?> |
|
208 |
<form action="system_routes.php" method="post"> |
|
209 |
<script type="text/javascript" src="/javascript/row_toggle.js"></script> |
|
210 |
<?php if ($savemsg) print_info_box($savemsg); ?> |
|
211 |
<?php if (is_subsystem_dirty('staticroutes')): ?><p> |
|
212 |
<?php print_info_box_np(sprintf(gettext("The static route configuration has been changed.%sYou must apply the changes in order for them to take effect."), "<br />"));?><br /></p> |
|
213 |
<?php endif; ?> |
|
204 |
if ($input_errors) |
|
205 |
print_input_errors($input_errors); |
|
206 |
if ($savemsg) |
|
207 |
print_info_box($savemsg); |
|
208 |
if (is_subsystem_dirty('staticroutes')) |
|
209 |
print_info_box_np(gettext("The static route configuration has been changed.") . "<br />" . gettext("You must apply the changes in order for them to take effect.")); |
|
210 |
|
|
211 |
$tab_array = array(); |
|
212 |
$tab_array[0] = array(gettext("Gateways"), false, "system_gateways.php"); |
|
213 |
$tab_array[1] = array(gettext("Routes"), true, "system_routes.php"); |
|
214 |
$tab_array[2] = array(gettext("Groups"), false, "system_gateway_groups.php"); |
|
215 |
display_top_tabs($tab_array); |
|
214 | 216 |
|
215 |
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system routes"> |
|
217 |
?> |
|
218 |
<table class="table"> |
|
219 |
<thead> |
|
216 | 220 |
<tr> |
217 |
<td> |
|
218 |
<?php |
|
219 |
$tab_array = array(); |
|
220 |
$tab_array[0] = array(gettext("Gateways"), false, "system_gateways.php"); |
|
221 |
$tab_array[1] = array(gettext("Routes"), true, "system_routes.php"); |
|
222 |
$tab_array[2] = array(gettext("Groups"), false, "system_gateway_groups.php"); |
|
223 |
display_top_tabs($tab_array); |
|
224 |
?> |
|
225 |
</td> |
|
221 |
<th></th> |
|
222 |
<th><?=gettext("Network")?></th> |
|
223 |
<th><?=gettext("Gateway")?></th> |
|
224 |
<th><?=gettext("Interface")?></th> |
|
225 |
<th><?=gettext("Description")?></th> |
|
226 |
<th></th> |
|
226 | 227 |
</tr> |
227 |
<tr> |
|
228 |
<td> |
|
229 |
<div id="mainarea"> |
|
230 |
<table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0" summary="main area"> |
|
231 |
<tr id="frheader"> |
|
232 |
<td width="2%" class="list"> </td> |
|
233 |
<td width="2%" class="list"> </td> |
|
234 |
<td width="22%" class="listhdrr"><?=gettext("Network");?></td> |
|
235 |
<td width="20%" class="listhdrr"><?=gettext("Gateway");?></td> |
|
236 |
<td width="15%" class="listhdrr"><?=gettext("Interface");?></td> |
|
237 |
<td width="29%" class="listhdr"><?=gettext("Description");?></td> |
|
238 |
<td width="10%" class="list"> |
|
239 |
<table border="0" cellspacing="0" cellpadding="1" summary="add"> |
|
240 |
<tr> |
|
241 |
<td width="17"></td> |
|
242 |
<td><a href="system_routes_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td> |
|
243 |
</tr> |
|
244 |
</table> |
|
245 |
</td> |
|
246 |
</tr> |
|
247 |
<?php $i = 0; foreach ($a_routes as $route): ?> |
|
248 |
<tr valign="top" id="fr<?=$i;?>"> |
|
249 |
<?php |
|
250 |
$iconfn = "pass"; |
|
251 |
if (isset($route['disabled'])) { |
|
252 |
$textss = "<span class=\"gray\">"; |
|
253 |
$textse = "</span>"; |
|
254 |
$iconfn .= "_d"; |
|
255 |
} else |
|
256 |
$textss = $textse = ""; |
|
257 |
?> |
|
258 |
<td class="listt"> |
|
259 |
<input type="checkbox" id="frc<?=$i;?>" name="route[]" value="<?=$i;?>" onclick="fr_bgcolor('<?=$i;?>')" style="margin: 0; padding: 0; width: 15px; height: 15px;" /> |
|
260 |
</td> |
|
261 |
<td class="listt" align="center"> |
|
262 |
<a href="?act=toggle&id=<?=$i;?>"> |
|
263 |
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_<?=$iconfn;?>.gif" width="11" height="11" border="0" |
|
264 |
title="<?=gettext("click to toggle enabled/disabled status");?>" alt="icon" /> |
|
265 |
</a> |
|
266 |
</td> |
|
267 |
<td class="listlr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';"> |
|
268 |
<?=$textss;?><?=strtolower($route['network']);?><?=$textse;?> |
|
269 |
</td> |
|
270 |
<td class="listr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';"> |
|
271 |
<?=$textss;?> |
|
272 |
<?php |
|
273 |
echo htmlentities($a_gateways[$route['gateway']]['name']) . " - " . htmlentities($a_gateways[$route['gateway']]['gateway']); |
|
274 |
?> |
|
275 |
<?=$textse;?> |
|
276 |
</td> |
|
277 |
<td class="listr" onclick="fr_toggle(<?=$i;?>)" id="frd<?=$i;?>" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';"> |
|
278 |
<?=$textss;?> |
|
279 |
<?php |
|
280 |
echo convert_friendly_interface_to_friendly_descr($a_gateways[$route['gateway']]['friendlyiface']) . " "; |
|
281 |
?> |
|
282 |
<?=$textse;?> |
|
283 |
</td> |
|
284 |
<td class="listbg" onclick="fr_toggle(<?=$i;?>)" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';"> |
|
285 |
<?=$textss;?><?=htmlspecialchars($route['descr']);?> <?=$textse;?> |
|
286 |
</td> |
|
287 |
<td class="list nowrap" valign="middle"> |
|
288 |
<table border="0" cellspacing="0" cellpadding="1" summary="move"> |
|
289 |
<tr> |
|
290 |
<td> |
|
291 |
<input onmouseover="fr_insline(<?=$i;?>, true)" onmouseout="fr_insline(<?=$i;?>, false)" name="move_<?=$i;?>" |
|
292 |
src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" |
|
293 |
title="<?=gettext("move selected routes before this route");?>" |
|
294 |
type="image" style="height:17;width:17;border:0" /> |
|
295 |
</td> |
|
296 |
<td> |
|
297 |
<a href="system_routes_edit.php?id=<?=$i;?>"> |
|
298 |
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" title="<?=gettext("edit route");?>" alt="edit" /> |
|
299 |
</a> |
|
300 |
</td> |
|
301 |
</tr> |
|
302 |
<tr> |
|
303 |
<td align="center" valign="middle"> |
|
304 |
<a href="system_routes.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this route?");?>')"> |
|
305 |
<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" title="<?=gettext("delete route");?>" alt="delete" /> |
|
306 |
</a> |
|
307 |
</td> |
|
308 |
<td> |
|
309 |
<a href="system_routes_edit.php?dup=<?=$i;?>"> |
|
310 |
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" title="<?=gettext("add a new route based on this one");?>" width="17" height="17" border="0" alt="duplicate" /> |
|
311 |
</a> |
|
312 |
</td> |
|
313 |
</tr> |
|
314 |
</table> |
|
315 |
</td> |
|
316 |
</tr> |
|
317 |
<?php $i++; endforeach; ?> |
|
318 |
<tr> |
|
319 |
<td class="list" colspan="6"></td> |
|
320 |
<td class="list nowrap" valign="middle"> |
|
321 |
<table border="0" cellspacing="0" cellpadding="1" summary="edit"> |
|
322 |
<tr> |
|
323 |
<td> |
|
324 |
<?php |
|
325 |
if ($i == 0): |
|
326 |
?> |
|
327 |
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_left_d.gif" width="17" height="17" |
|
328 |
title="<?=gettext("move selected routes to end");?>" border="0" alt="move" /> |
|
329 |
<?php |
|
330 |
else: |
|
331 |
?> |
|
332 |
<input name="move_<?=$i;?>" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_left.gif" |
|
333 |
style="width:17;height:17;border:0" title="<?=gettext("move selected routes to end");?>" /> |
|
334 |
<?php |
|
335 |
endif; |
|
336 |
?> |
|
337 |
</td> |
|
338 |
<td> |
|
339 |
<a href="system_routes_edit.php"> |
|
340 |
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" |
|
341 |
title="<?=gettext("add new route");?>" alt="add" /> |
|
342 |
</a> |
|
343 |
</td> |
|
344 |
</tr> |
|
345 |
<tr> |
|
346 |
<td> |
|
347 |
<?php |
|
348 |
if ($i == 0): |
|
349 |
?> |
|
350 |
<img src="/themes/<?= $g['theme']; ?>/images/icons/icon_x_d.gif" width="17" height="17" |
|
351 |
title="<?=gettext("delete selected routes");?>" border="0" alt="delete" /> |
|
352 |
<?php |
|
353 |
else: |
|
354 |
?> |
|
355 |
<input name="del" type="image" src="/themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" |
|
356 |
style="width:17;height:17" title="<?=gettext("delete selected routes");?>" |
|
357 |
onclick="return confirm('<?=gettext("Do you really want to delete the selected routes?");?>')" /> |
|
228 |
</thead> |
|
229 |
<tbody> |
|
358 | 230 |
<?php |
359 |
endif; |
|
231 |
foreach ($a_routes as $i => $route): |
|
232 |
if (isset($route['disabled'])) |
|
233 |
$icon = 'icon-ban-circle'; |
|
234 |
else |
|
235 |
$icon = 'icon-ok-circle'; |
|
360 | 236 |
?> |
361 |
</td> |
|
362 |
</tr> |
|
363 |
</table> |
|
364 |
</td> |
|
365 |
</tr> |
|
366 |
</table> |
|
367 |
</div> |
|
237 |
<tr<?=($icon != 'icon-ok-circle')? ' class="disabled"' : ''?>> |
|
238 |
<td><i class="icon <?=$icon?>"></i></td> |
|
239 |
<td> |
|
240 |
<?=strtolower($route['network'])?> |
|
241 |
</td> |
|
242 |
<td> |
|
243 |
<?=htmlentities($a_gateways[$route['gateway']]['name']) . " - " . htmlentities($a_gateways[$route['gateway']]['gateway'])?> |
|
244 |
</td> |
|
245 |
<td> |
|
246 |
<?=convert_friendly_interface_to_friendly_descr($a_gateways[$route['gateway']]['friendlyiface'])?> |
|
247 |
</td> |
|
248 |
<td> |
|
249 |
<?=htmlspecialchars($route['descr'])?> |
|
368 | 250 |
</td> |
251 |
<td> |
|
252 |
<a class="btn btn-xs btn-primary" href="system_routes_edit.php?id=<?=$i?>"> |
|
253 |
edit |
|
254 |
</a> |
|
255 |
|
|
256 |
<a class="btn btn-xs btn-default" href="system_routes_edit.php?dup=<?=$i?>"> |
|
257 |
copy |
|
258 |
</a> |
|
259 |
|
|
260 |
<a class="btn btn-xs btn-danger" href="system_routes.php?act=del&id=<?=$i?>"> |
|
261 |
delete |
|
262 |
</a> |
|
263 |
|
|
264 |
<a class="btn btn-xs btn-default" href="?act=toggle&id=<?=$i?>"> |
|
265 |
toggle |
|
266 |
</a> |
|
267 |
</td> |
|
268 |
<? endforeach?> |
|
369 | 269 |
</tr> |
370 | 270 |
</table> |
371 |
</form> |
|
372 |
<p><b><?=gettext("Note:");?></b> <?=gettext("Do not enter static routes for networks assigned on any interface of this firewall. Static routes are only used for networks reachable via a different router, and not reachable via your default gateway.");?></p> |
|
373 |
<?php include("fend.inc"); ?> |
|
374 |
</body> |
|
375 |
</html> |
|
271 |
|
|
272 |
<nav class="action-buttons"> |
|
273 |
<a href="system_routes_edit.php" role="button" class="btn btn-success"> |
|
274 |
<?=gettext("add new route")?> |
|
275 |
</a> |
|
276 |
</nav> |
|
277 |
<?php |
|
278 |
|
|
279 |
include("foot.inc"); |
Also available in: Unified diff
Converted system_routes*, pending implementation of direct gw addition