Project

General

Profile

Bug #12174 » firewall_rules.php_02AUG2021.patch

lufte grof, 08/02/2021 02:39 PM

View differences:

firewall_rules.php 2021-08-02 19:24:15.297799000 +0000
487 487
// More efficient than looping through the list of separators on every row.
488 488
$seprows = separator_rows($separators);
489 489

  
490
/* Cache gateway status for this page load.
491
 * See https://redmine.pfsense.org/issues/12174 */
492
$gws = array();
493
$gateways_status = return_gateways_status(true);
494
foreach ($config['gateways']['gateway_group'] as $i => $gwgroup) {
495
	foreach ($gwgroup['item'] as $x => $member) {
496
		$membersplit = explode("|", $member);
497
		$gwgroup['item'][$x] = $membersplit[0];
498
	}
499
	$content = "<table>\n";
500
	$content .= "<thead>\n";
501
	$content .= "<tr>\n";
502
	$content .= "<th>" . gettext("Name") . "</th><th style='padding-left: 10px;'>" . gettext("Interface") . "</th>";
503
	$content .= "<th style='padding-left: 10px;'>" . gettext("Gateway") . "</th></tr>\n";
504
	$content .= "</thead>\n";
505
	$content .= "<tbody>\n";
506
	foreach ($gwgroup['item'] as $i => $gw) {
507
		$content .= gateway_info_popup($gw, $gateways_status);
508
	}
509
	$content .= "</tbody>\n";
510
	$content .= "</table>\n";
511
	$gws[$gwgroup['name']] = $content;
512
}
513
$a_gateways = return_gateways_array();
514
foreach ($a_gateways as $i => $gw) {
515
	$content = "<table>\n";
516
	$content .= "<thead>\n";
517
	$content .= "<tr>\n";
518
	$content .= "<th>" . gettext("Name") . "</th><th style='padding-left: 10px;'>" . gettext("Interface") . "</th>";
519
	$content .= "<th style='padding-left: 10px;'>" . gettext("Gateway") . "</th></tr>\n";
520
	$content .= gateway_info_popup($i, $gateways_status);
521
	$content .= "</thead>\n";
522
	$content .= "<tbody>\n";
523
	$gws[$i] = $content;
524
}
525

  
490 526
foreach ($a_filter as $filteri => $filterent):
491 527

  
492 528
	if (($filterent['interface'] == $if && !isset($filterent['floating'])) || (isset($filterent['floating']) && "FloatingRules" == $if)) {
......
820 856
						</td>
821 857
						<td>
822 858
							<?php if (isset($filterent['gateway'])): ?>
823
								<span data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Gateways details')?>" data-content="<?=gateway_info_popup($filterent['gateway'])?>" data-html="true">
859
								<span data-toggle="popover" data-trigger="hover focus" title="<?=gettext('Gateways details')?>" data-content="<?=$gws[$filterent['gateway']]?>" data-html="true">
824 860
							<?php else: ?>
825 861
								<span>
826 862
							<?php endif; ?>
(3-3/3)